forked from blisstown/campfire
finish URL rewrite, remove redundant logged_in state
This commit is contained in:
parent
a3fdd0007c
commit
4d771d8ebd
9 changed files with 20 additions and 27 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue