Removed top-level await

main
Eloi Zalczer 2024-07-04 14:53:03 +02:00
parent 2985c58dd6
commit 3af6d96d28
1 changed files with 3 additions and 5 deletions

View File

@ -6,11 +6,9 @@ export const pb = new PocketBase(import.meta.env.VITE_POCKETBASE_URL);
export const currentUser = ref(); export const currentUser = ref();
if (pb.authStore.isValid) { if (pb.authStore.isValid) {
try { pb.collection("users")
await pb.collection("users").authRefresh(); .authRefresh()
} catch (err) { .catch((_) => pb.authStore.clear());
pb.authStore.clear();
}
} }
pb.authStore.onChange(() => { pb.authStore.onChange(() => {