mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-04-30 12:22:12 +03:00
Refactor set/get current account ID
And add fallback for standalone mode where session storage is not enough
This commit is contained in:
parent
aefda31c2a
commit
e782cc0dde
13 changed files with 57 additions and 27 deletions
src/utils
|
@ -7,6 +7,7 @@ import {
|
|||
getAccountByInstance,
|
||||
getCurrentAccount,
|
||||
saveAccount,
|
||||
setCurrentAccountID,
|
||||
} from './store-utils';
|
||||
|
||||
// Default *fallback* instance
|
||||
|
@ -118,7 +119,7 @@ export async function initAccount(client, instance, accessToken, vapidKey) {
|
|||
const mastoAccount = await masto.v1.accounts.verifyCredentials();
|
||||
|
||||
console.log('CURRENTACCOUNT SET', mastoAccount.id);
|
||||
store.session.set('currentAccount', mastoAccount.id);
|
||||
setCurrentAccountID(mastoAccount.id);
|
||||
|
||||
saveAccount({
|
||||
info: mastoAccount,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue