phanpy/src/utils/store-utils.js

10 lines
297 B
JavaScript
Raw Normal View History

2023-01-11 08:28:42 +03:00
import store from './store';
export function getCurrentAccount() {
const accounts = store.local.getJSON('accounts') || [];
const currentAccount = store.session.get('currentAccount');
const account =
accounts.find((a) => a.info.id === currentAccount) || accounts[0];
return account;
}