this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Init states again after login to new account

+26 -1
+2 -1
src/app.jsx
··· 58 58 import { getAccessToken } from './utils/auth'; 59 59 import openCompose from './utils/open-compose'; 60 60 import showToast from './utils/show-toast'; 61 - import states, { getStatus, saveStatus } from './utils/states'; 61 + import states, { initStates, saveStatus } from './utils/states'; 62 62 import store from './utils/store'; 63 63 import { getCurrentAccount } from './utils/store-utils'; 64 64 import useInterval from './utils/useInterval'; ··· 130 130 initInstance(masto, instanceURL), 131 131 initAccount(masto, instanceURL, accessToken), 132 132 ]); 133 + initStates(); 133 134 initPreferences(masto); 134 135 135 136 setIsLoggedIn(true);
+24
src/utils/states.js
··· 60 60 61 61 export default states; 62 62 63 + export function initStates() { 64 + // init all account based states 65 + // all keys that uses store.account.get() should be initialized here 66 + states.notificationsLast = store.account.get('notificationsLast') || null; 67 + states.shortcuts = store.account.get('shortcuts') ?? []; 68 + states.settings.autoRefresh = 69 + store.account.get('settings-autoRefresh') ?? false; 70 + states.settings.shortcutsViewMode = 71 + store.account.get('settings-shortcutsViewMode') ?? null; 72 + states.settings.shortcutsColumnsMode = 73 + store.account.get('settings-shortcutsColumnsMode') ?? false; 74 + states.settings.boostsCarousel = 75 + store.account.get('settings-boostsCarousel') ?? true; 76 + states.settings.contentTranslation = 77 + store.account.get('settings-contentTranslation') ?? true; 78 + states.settings.contentTranslationTargetLanguage = 79 + store.account.get('settings-contentTranslationTargetLanguage') || null; 80 + states.settings.contentTranslationHideLanguages = 81 + store.account.get('settings-contentTranslationHideLanguages') || []; 82 + states.settings.contentTranslationAutoInline = 83 + store.account.get('settings-contentTranslationAutoInline') ?? false; 84 + states.settings.cloakMode = store.account.get('settings-cloakMode') ?? false; 85 + } 86 + 63 87 subscribeKey(states, 'notificationsLast', (v) => { 64 88 console.log('CHANGE', v); 65 89 store.account.set('notificationsLast', states.notificationsLast);