diff --git a/hub/site/src/lib/utils.ts b/hub/site/src/lib/utils.ts index 5bbe988..85d537b 100644 --- a/hub/site/src/lib/utils.ts +++ b/hub/site/src/lib/utils.ts @@ -34,16 +34,27 @@ const verifyAuth = () => { .authRefresh() .catch(() => { pb.authStore.clear() + toast({ + title: 'Failed to authenticate', + description: 'Please log in again', + variant: 'destructive', + }) }) } export const updateSystemList = async () => { - try { - const records = await pb.collection('systems').getFullList({ sort: '+name' }) + // try { + const records = await pb.collection('systems').getFullList({ sort: '+name' }) + if (records.length) { $systems.set(records) - } catch (e) { + } else { verifyAuth() } + // } + // catch (e) { + // console.log('verifying auth error', e) + // verifyAuth() + // } } export const updateAlerts = () => {