fix localstorage not working on phone close #8
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import { boot } from 'quasar/wrappers';
|
||||
import { useUserStore } from 'src/vueLib/login/userStore';
|
||||
import { appApi } from './axios';
|
||||
|
||||
export default boot(async ({ router }) => {
|
||||
const userStore = useUserStore();
|
||||
// load user
|
||||
try {
|
||||
const { data } = await appApi.get('/login/me');
|
||||
await userStore.setUser(data);
|
||||
} catch {
|
||||
/* ignore error */
|
||||
}
|
||||
|
||||
// Restore logic after router is ready but before navigation
|
||||
router.isReady().then(() => {
|
||||
|
||||
Reference in New Issue
Block a user