-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rebase; refactor site metadata; persist perms
show "connected" account in popup
- Loading branch information
Showing
17 changed files
with
202 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
module.exports = createOriginMiddleware | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const version = 34 | ||
const clone = require('clone') | ||
|
||
/** | ||
* The purpose of this migration is to enable the {@code privacyMode} feature flag and set the user as being migrated | ||
* if it was {@code false}. | ||
*/ | ||
module.exports = { | ||
version, | ||
migrate: async function (originalVersionedData) { | ||
const versionedData = clone(originalVersionedData) | ||
versionedData.meta.version = version | ||
const state = versionedData.data | ||
versionedData.data = transformState(state) | ||
return versionedData | ||
}, | ||
} | ||
|
||
function transformState (state) { | ||
const { PreferencesController } = state | ||
|
||
if (PreferencesController) { | ||
const featureFlags = PreferencesController.featureFlags || {} | ||
|
||
if (!featureFlags.privacyMode && typeof PreferencesController.migratedPrivacyMode === 'undefined') { | ||
// Mark the state has being migrated and enable Privacy Mode | ||
PreferencesController.migratedPrivacyMode = true | ||
featureFlags.privacyMode = true | ||
} | ||
} | ||
|
||
return state | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.