finish URL rewrite, remove redundant logged_in state

This commit is contained in:
ari melody 2024-07-07 14:58:59 +01:00
parent a3fdd0007c
commit 4d771d8ebd
Signed by: ari
GPG key ID: CF99829C92678188
9 changed files with 20 additions and 27 deletions

View file

@ -1,16 +1,15 @@
<script>
import { notifications, getNotifications } from '$lib/notifications.js';
import { logged_in } from '$lib/stores/account.js';
import { account } from '$lib/stores/account.js';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { get } from 'svelte/store';
import Notification from '$lib/ui/Notification.svelte';
if (!get(logged_in)) goto("/");
if (!$account) goto("/");
getNotifications();
document.addEventListener("scroll", event => {
if (get(logged_in) && get(page).url.pathname !== "/notifications") return;
document.addEventListener("scroll", () => {
if ($account && $page.url.pathname !== "/notifications") return;
if (window.innerHeight + window.scrollY >= document.body.offsetHeight - 2048) {
getNotifications();
}