mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-26 07:34:44 +01:00
commit
cd68aee186
4 changed files with 22 additions and 18 deletions
|
@ -126,11 +126,13 @@ function App() {
|
|||
setUIState('default');
|
||||
})();
|
||||
} else {
|
||||
window.__IGNORE_GET_ACCOUNT_ERROR__ = true;
|
||||
const account = getCurrentAccount();
|
||||
if (account) {
|
||||
store.session.set('currentAccount', account.info.id);
|
||||
const { masto, instance } = api({ account });
|
||||
console.log('masto', masto);
|
||||
initStates();
|
||||
initPreferences(masto);
|
||||
setUIState('loading');
|
||||
(async () => {
|
||||
|
|
|
@ -99,8 +99,10 @@
|
|||
text-shadow: 0 var(--hairline-width) var(--bg-color);
|
||||
width: 100%;
|
||||
|
||||
&:is(:hover, :focus) {
|
||||
color: var(--text-color);
|
||||
@media (hover: hover) {
|
||||
&:is(:hover, :focus) {
|
||||
color: var(--text-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
#shortcuts .tab-bar li a:active {
|
||||
|
|
|
@ -18,7 +18,7 @@ const states = proxy({
|
|||
homeLast: null, // Last item in 'home' list
|
||||
homeLastFetchTime: null,
|
||||
notifications: [],
|
||||
notificationsLast: store.account.get('notificationsLast') || null, // Last read notification
|
||||
notificationsLast: null, // Last read notification
|
||||
notificationsNew: [],
|
||||
notificationsShowNew: false,
|
||||
notificationsLastFetchTime: null,
|
||||
|
@ -46,23 +46,18 @@ const states = proxy({
|
|||
showGenericAccounts: false,
|
||||
showMediaAlt: false,
|
||||
// Shortcuts
|
||||
shortcuts: store.account.get('shortcuts') ?? [],
|
||||
shortcuts: [],
|
||||
// Settings
|
||||
settings: {
|
||||
autoRefresh: store.account.get('settings-autoRefresh') ?? false,
|
||||
shortcutsViewMode: store.account.get('settings-shortcutsViewMode') ?? null,
|
||||
shortcutsColumnsMode:
|
||||
store.account.get('settings-shortcutsColumnsMode') ?? false,
|
||||
boostsCarousel: store.account.get('settings-boostsCarousel') ?? true,
|
||||
contentTranslation:
|
||||
store.account.get('settings-contentTranslation') ?? true,
|
||||
contentTranslationTargetLanguage:
|
||||
store.account.get('settings-contentTranslationTargetLanguage') || null,
|
||||
contentTranslationHideLanguages:
|
||||
store.account.get('settings-contentTranslationHideLanguages') || [],
|
||||
contentTranslationAutoInline:
|
||||
store.account.get('settings-contentTranslationAutoInline') ?? false,
|
||||
cloakMode: store.account.get('settings-cloakMode') ?? false,
|
||||
autoRefresh: false,
|
||||
shortcutsViewMode: null,
|
||||
shortcutsColumnsMode: false,
|
||||
boostsCarousel: true,
|
||||
contentTranslation: true,
|
||||
contentTranslationTargetLanguage: null,
|
||||
contentTranslationHideLanguages: [],
|
||||
contentTranslationAutoInline: false,
|
||||
cloakMode: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -11,6 +11,11 @@ export function getAccountByAccessToken(accessToken) {
|
|||
}
|
||||
|
||||
export function getCurrentAccount() {
|
||||
if (!window.__IGNORE_GET_ACCOUNT_ERROR__) {
|
||||
// Track down getCurrentAccount() calls before account-based states are initialized
|
||||
console.error('getCurrentAccount() called before states are initialized');
|
||||
if (import.meta.env.DEV) console.trace();
|
||||
}
|
||||
const currentAccount = store.session.get('currentAccount');
|
||||
const account = getAccount(currentAccount);
|
||||
return account;
|
||||
|
|
Loading…
Add table
Reference in a new issue