quickload list implemented
This commit is contained in:
+5
-1
@@ -30,12 +30,16 @@ const App: Component = () => {
|
||||
window.addEventListener('popstate', handleLocChange);
|
||||
window.addEventListener('hashchange', handleLocChange);
|
||||
|
||||
let isFirstRun = true;
|
||||
const removeListener = pb.authStore.onChange((token) => {
|
||||
console.log('[DEBUG] pb.authStore.onChange fired, token present:', !!token);
|
||||
const wasAuthenticated = isAuthenticated();
|
||||
setIsAuthenticated(!!token);
|
||||
if (token) {
|
||||
|
||||
if (token && (isFirstRun || !wasAuthenticated)) {
|
||||
initStore();
|
||||
}
|
||||
isFirstRun = false;
|
||||
}, true);
|
||||
|
||||
onCleanup(() => {
|
||||
|
||||
Reference in New Issue
Block a user