remove relatime notification subscription
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
beforeNavigate,
|
beforeNavigate,
|
||||||
goto,
|
goto,
|
||||||
invalidate,
|
invalidate,
|
||||||
invalidateAll
|
invalidateAll,
|
||||||
} from "$app/navigation";
|
} from "$app/navigation";
|
||||||
|
|
||||||
import { page } from "$app/state";
|
import { page } from "$app/state";
|
||||||
@@ -24,7 +24,10 @@
|
|||||||
import PocketBase from "pocketbase";
|
import PocketBase from "pocketbase";
|
||||||
import { browser } from "$app/environment";
|
import { browser } from "$app/environment";
|
||||||
|
|
||||||
interface Props { data: LayoutData; children?: Snippet }
|
interface Props {
|
||||||
|
data: LayoutData;
|
||||||
|
children?: Snippet;
|
||||||
|
}
|
||||||
|
|
||||||
let { data, children }: Props = $props();
|
let { data, children }: Props = $props();
|
||||||
|
|
||||||
@@ -39,18 +42,6 @@
|
|||||||
if (page.data.origin != location.origin) {
|
if (page.data.origin != location.origin) {
|
||||||
showWarning = true;
|
showWarning = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pb = new PocketBase(env.PUBLIC_POCKETBASE_URL);
|
|
||||||
|
|
||||||
if (browser) {
|
|
||||||
pb.authStore.loadFromCookie(document.cookie);
|
|
||||||
}
|
|
||||||
|
|
||||||
pb.collection("notifications").subscribe("*", async (e) => {
|
|
||||||
if (e.action === "create") {
|
|
||||||
await invalidateAll();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let hideDemoHint = $state(false);
|
let hideDemoHint = $state(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user