Skip to content

Commit 4e48319

Browse files
committed
Fixed bug in 1.6.0 webext upgrade process where old log entries were being migrated.
Fixed small styling issue with header.
1 parent 6e807d0 commit 4e48319

File tree

3 files changed

+49
-52
lines changed

3 files changed

+49
-52
lines changed

src/modules/android/android-shared/android-upgrade/android-v1.6.0-upgrade-provider.service.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ export class AndroidV160UpgradeProviderService extends V160UpgradeProviderServic
4747
}
4848

4949
upgradeApp(upgradingFromVersion?: string): ng.IPromise<void> {
50-
// Get current native storage items
50+
// Migrate items in native storage to new store
5151
return this.getAllFromNativeStorage().then((cachedData) => {
52-
// Initialise store
5352
return this.storeSvc
5453
.init()
5554
.then(() => {
@@ -60,11 +59,10 @@ export class AndroidV160UpgradeProviderService extends V160UpgradeProviderServic
6059
const syncInfo: Partial<ApiXbrowsersyncSyncInfo> = {
6160
serviceType: ApiServiceType.xBrowserSync
6261
};
63-
64-
// Add settings from previous version to store
6562
return this.$q
6663
.all(
6764
Object.keys(cachedData).map((key) => {
65+
// Ignore items that should not be migrated
6866
if (key === 'appVersion' || key === 'password' || key === 'traceLog') {
6967
return;
7068
}

src/modules/webext/shared/webext-upgrade/webext-v1.6.0-upgrade-provider.service.ts

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -36,57 +36,54 @@ export class WebExtV160UpgradeProviderService extends V160UpgradeProviderService
3636
}
3737

3838
upgradeApp(upgradingFromVersion?: string): ng.IPromise<void> {
39-
// Initialise IndexedDB data storage
40-
return (
41-
this.storeSvc
42-
.init()
43-
// Convert local storage items to IndexedDB
44-
.then(() => browser.storage.local.get())
45-
.then((cachedData) => {
46-
if (!cachedData || Object.keys(cachedData).length === 0) {
47-
return;
48-
}
39+
// Migrate items in local storage to new IndexedDB store
40+
return this.storeSvc
41+
.init()
42+
.then(() => browser.storage.local.get())
43+
.then((cachedData) => {
44+
if (!cachedData || Object.keys(cachedData).length === 0) {
45+
return;
46+
}
4947

50-
const syncInfo: Partial<ApiXbrowsersyncSyncInfo> = {
51-
serviceType: ApiServiceType.xBrowserSync
52-
};
53-
54-
return this.$q
55-
.all(
56-
Object.keys(cachedData).map((key) => {
57-
if (key === 'password') {
58-
return;
59-
}
60-
61-
// Upgrade sync settings
62-
switch (key) {
63-
case 'serviceUrl':
64-
syncInfo.serviceUrl = cachedData[key];
65-
return;
66-
case 'syncId':
67-
syncInfo.id = cachedData[key];
68-
return;
69-
case 'syncVersion':
70-
syncInfo.version = cachedData[key];
71-
return;
72-
default:
73-
}
74-
75-
return this.storeSvc.set(key, cachedData[key]);
76-
})
77-
)
78-
.then(() => {
79-
if (!syncInfo.id) {
48+
const syncInfo: Partial<ApiXbrowsersyncSyncInfo> = {
49+
serviceType: ApiServiceType.xBrowserSync
50+
};
51+
return this.$q
52+
.all(
53+
Object.keys(cachedData).map((key) => {
54+
// Ignore items that should not be migrated
55+
if (key === 'password' || key === 'traceLog') {
8056
return;
8157
}
82-
if (!syncInfo.serviceUrl) {
83-
syncInfo.serviceUrl = Globals.URL.DefaultServiceUrl;
58+
59+
// Upgrade sync settings
60+
switch (key) {
61+
case 'serviceUrl':
62+
syncInfo.serviceUrl = cachedData[key];
63+
return;
64+
case 'syncId':
65+
syncInfo.id = cachedData[key];
66+
return;
67+
case 'syncVersion':
68+
syncInfo.version = cachedData[key];
69+
return;
70+
default:
8471
}
85-
return this.storeSvc.set(StoreKey.SyncInfo, syncInfo);
86-
});
87-
})
88-
.then(() => browser.storage.local.clear())
89-
.then(() => super.upgradeApp())
90-
);
72+
73+
return this.storeSvc.set(key, cachedData[key]);
74+
})
75+
)
76+
.then(() => {
77+
if (!syncInfo.id) {
78+
return;
79+
}
80+
if (!syncInfo.serviceUrl) {
81+
syncInfo.serviceUrl = Globals.URL.DefaultServiceUrl;
82+
}
83+
return this.storeSvc.set(StoreKey.SyncInfo, syncInfo);
84+
});
85+
})
86+
.then(() => browser.storage.local.clear())
87+
.then(() => super.upgradeApp());
9188
}
9289
}

src/styles/partials/_layout.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
.header-panel {
2828
align-items: center;
2929
display: flex;
30+
flex: 0 0 auto;
3031
font-size: 1.3rem;
3132
justify-content: space-between;
3233
margin-bottom: 0.75rem;
@@ -129,6 +130,7 @@
129130
border-width: 0;
130131
color: var(--color-well-text);
131132
margin-bottom: 0.75rem;
133+
overflow: hidden;
132134
padding: 1rem 1.25rem;
133135

134136
a {

0 commit comments

Comments
 (0)