fix localstorage not working on phone close #8

This commit is contained in:
Adrian Zürcher
2025-11-09 22:32:22 +01:00
parent f1d7d3617d
commit f7d5d9d019

View File

@@ -1,8 +1,16 @@
import { boot } from 'quasar/wrappers'; import { boot } from 'quasar/wrappers';
import { useUserStore } from 'src/vueLib/login/userStore'; import { useUserStore } from 'src/vueLib/login/userStore';
import { appApi } from './axios';
export default boot(async ({ router }) => { export default boot(async ({ router }) => {
const userStore = useUserStore(); 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 // Restore logic after router is ready but before navigation
router.isReady().then(() => { router.isReady().then(() => {