this repo has no description
0
fork

Configure Feed

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

Fix load wrong account's stuff when adding new account

Some account-based calls were called before states are initialized

+18 -16
+2
src/app.jsx
··· 126 126 setUIState('default'); 127 127 })(); 128 128 } else { 129 + window.__IGNORE_GET_ACCOUNT_ERROR__ = true; 129 130 const account = getCurrentAccount(); 130 131 if (account) { 131 132 store.session.set('currentAccount', account.info.id); 132 133 const { masto, instance } = api({ account }); 133 134 console.log('masto', masto); 135 + initStates(); 134 136 initPreferences(masto); 135 137 setUIState('loading'); 136 138 (async () => {
+11 -16
src/utils/states.js
··· 18 18 homeLast: null, // Last item in 'home' list 19 19 homeLastFetchTime: null, 20 20 notifications: [], 21 - notificationsLast: store.account.get('notificationsLast') || null, // Last read notification 21 + notificationsLast: null, // Last read notification 22 22 notificationsNew: [], 23 23 notificationsShowNew: false, 24 24 notificationsLastFetchTime: null, ··· 46 46 showGenericAccounts: false, 47 47 showMediaAlt: false, 48 48 // Shortcuts 49 - shortcuts: store.account.get('shortcuts') ?? [], 49 + shortcuts: [], 50 50 // Settings 51 51 settings: { 52 - autoRefresh: store.account.get('settings-autoRefresh') ?? false, 53 - shortcutsViewMode: store.account.get('settings-shortcutsViewMode') ?? null, 54 - shortcutsColumnsMode: 55 - store.account.get('settings-shortcutsColumnsMode') ?? false, 56 - boostsCarousel: store.account.get('settings-boostsCarousel') ?? true, 57 - contentTranslation: 58 - store.account.get('settings-contentTranslation') ?? true, 59 - contentTranslationTargetLanguage: 60 - store.account.get('settings-contentTranslationTargetLanguage') || null, 61 - contentTranslationHideLanguages: 62 - store.account.get('settings-contentTranslationHideLanguages') || [], 63 - contentTranslationAutoInline: 64 - store.account.get('settings-contentTranslationAutoInline') ?? false, 65 - cloakMode: store.account.get('settings-cloakMode') ?? false, 52 + autoRefresh: false, 53 + shortcutsViewMode: null, 54 + shortcutsColumnsMode: false, 55 + boostsCarousel: true, 56 + contentTranslation: true, 57 + contentTranslationTargetLanguage: null, 58 + contentTranslationHideLanguages: [], 59 + contentTranslationAutoInline: false, 60 + cloakMode: false, 66 61 }, 67 62 }); 68 63
+5
src/utils/store-utils.js
··· 11 11 } 12 12 13 13 export function getCurrentAccount() { 14 + if (!window.__IGNORE_GET_ACCOUNT_ERROR__) { 15 + // Track down getCurrentAccount() calls before account-based states are initialized 16 + console.error('getCurrentAccount() called before states are initialized'); 17 + if (import.meta.env.DEV) console.trace(); 18 + } 14 19 const currentAccount = store.session.get('currentAccount'); 15 20 const account = getAccount(currentAccount); 16 21 return account;