Undefined storage area. Fixes #508
This commit is contained in:
parent
26e6efd611
commit
02300630f6
1 changed files with 12 additions and 12 deletions
24
index.js
24
index.js
|
@ -124,7 +124,8 @@ const ContainerService = {
|
||||||
// uninstallation. This object contains also a version number, in case we
|
// uninstallation. This object contains also a version number, in case we
|
||||||
// need to implement a migration in the future.
|
// need to implement a migration in the future.
|
||||||
// In 1.1.1 and less we deleted savedConfiguration on upgrade so we need to rebuild
|
// In 1.1.1 and less we deleted savedConfiguration on upgrade so we need to rebuild
|
||||||
if (!ss.storage.savedConfiguration ||
|
if (!("savedConfiguration" in ss.storage) ||
|
||||||
|
!("prefs" in ss.storage.savedConfiguration) ||
|
||||||
(installation && reason !== "upgrade")) {
|
(installation && reason !== "upgrade")) {
|
||||||
let preInstalledIdentities = []; // eslint-disable-line prefer-const
|
let preInstalledIdentities = []; // eslint-disable-line prefer-const
|
||||||
ContextualIdentityProxy.getIdentities().forEach(identity => {
|
ContextualIdentityProxy.getIdentities().forEach(identity => {
|
||||||
|
@ -144,8 +145,8 @@ const ContainerService = {
|
||||||
|
|
||||||
ss.storage.savedConfiguration = object;
|
ss.storage.savedConfiguration = object;
|
||||||
|
|
||||||
// Maybe rename the Banking container.
|
|
||||||
if (prefService.get("privacy.userContext.enabled") !== true) {
|
if (prefService.get("privacy.userContext.enabled") !== true) {
|
||||||
|
// Maybe rename the Banking container.
|
||||||
const identity = ContextualIdentityProxy.getIdentityFromId(3);
|
const identity = ContextualIdentityProxy.getIdentityFromId(3);
|
||||||
if (identity && identity.l10nID === "userContextBanking.label") {
|
if (identity && identity.l10nID === "userContextBanking.label") {
|
||||||
ContextualIdentityProxy.update(identity.userContextId,
|
ContextualIdentityProxy.update(identity.userContextId,
|
||||||
|
@ -153,17 +154,16 @@ const ContainerService = {
|
||||||
identity.icon,
|
identity.icon,
|
||||||
identity.color);
|
identity.color);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Let's create the default containers in case there are none.
|
// Let's create the default containers in case there are none.
|
||||||
if (prefService.get("privacy.userContext.enabled") !== true &&
|
if (ss.storage.savedConfiguration.preInstalledIdentities.length === 0) {
|
||||||
ss.storage.savedConfiguration.preInstalledIdentities.length === 0) {
|
// Note: we have to create them in this way because there is no way to
|
||||||
// Note: we have to create them in this way because there is no way to
|
// reuse the same ID and the localized strings.
|
||||||
// reuse the same ID and the localized strings.
|
ContextualIdentityService.create("Personal", "fingerprint", "blue");
|
||||||
ContextualIdentityService.create("Personal", "fingerprint", "blue");
|
ContextualIdentityService.create("Work", "briefcase", "orange");
|
||||||
ContextualIdentityService.create("Work", "briefcase", "orange");
|
ContextualIdentityService.create("Finance", "dollar", "green");
|
||||||
ContextualIdentityService.create("Finance", "dollar", "green");
|
ContextualIdentityService.create("Shopping", "cart", "pink");
|
||||||
ContextualIdentityService.create("Shopping", "cart", "pink");
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue