-
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.
Default Privacy Mode to ON, allow force sharing address
- Loading branch information
Showing
21 changed files
with
576 additions
and
117 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.