Update Settings.js
This commit is contained in:
parent
00ae0a594c
commit
f89ab5c0a7
1 changed files with 6 additions and 4 deletions
|
|
@ -22,7 +22,6 @@ import {
|
|||
const UserStore = findByStoreName("UserStore");
|
||||
const TokenManager = findByProps("getToken");
|
||||
|
||||
|
||||
if (!storage.accounts) storage.accounts = {};
|
||||
if (!storage.accountOrder) storage.accountOrder = [];
|
||||
if (!storage.settings) {
|
||||
|
|
@ -32,20 +31,23 @@ if (!storage.settings) {
|
|||
enableUnsafeFeatures: false
|
||||
};
|
||||
} else {
|
||||
|
||||
if (storage.settings.enableUnsafeFeatures === undefined) {
|
||||
storage.settings.enableUnsafeFeatures = false;
|
||||
}
|
||||
if (storage.settings.enableCLI === undefined) {
|
||||
storage.settings.enableCLI = storage.settings.showAccountNames !== false; // Migrate from old setting
|
||||
storage.settings.enableCLI = storage.settings.showAccountNames !== false;
|
||||
}
|
||||
if (storage.settings.confirmBeforeDelete === undefined) {
|
||||
storage.settings.confirmBeforeDelete = true;
|
||||
}
|
||||
|
||||
if (storage.settings.showAccountNames !== undefined) {
|
||||
delete storage.settings.showAccountNames;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
addLog('info', 'AccountSwitcher plugin initialized', {
|
||||
accountsCount: Object.keys(storage.accounts).length,
|
||||
cliEnabled: storage.settings.enableCLI,
|
||||
|
|
@ -495,7 +497,7 @@ export default function AccountsManager(props) {
|
|||
React.createElement(ReactNative.Text, {
|
||||
key: "title",
|
||||
style: { color: 'white', fontSize: 20, fontWeight: 'bold' }
|
||||
}, "MoreAlts"),
|
||||
}, "Account Switcher"),
|
||||
React.createElement(ReactNative.TouchableOpacity, {
|
||||
key: "settings-btn",
|
||||
onPress: () => setShowSettings(true),
|
||||
|
|
@ -1643,4 +1645,4 @@ export default function AccountsManager(props) {
|
|||
]);
|
||||
}
|
||||
|
||||
export { addLog };
|
||||
export { addLog };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue