diff --git a/src/lib/ui/Navigation.svelte b/src/lib/ui/Navigation.svelte index 0d12e40..0566ef2 100644 --- a/src/lib/ui/Navigation.svelte +++ b/src/lib/ui/Navigation.svelte @@ -6,6 +6,7 @@ import { Client } from '$lib/client/client.js'; import { play_sound } from '$lib/sound.js'; import { getTimeline } from '$lib/timeline.js'; + import { goto } from '$app/navigation'; const VERSION = APP_VERSION; @@ -26,7 +27,7 @@ }); return; } - location = "/"; + goto("/"); } function log_out() { diff --git a/src/lib/ui/post/Post.svelte b/src/lib/ui/post/Post.svelte index 9b9959f..df89839 100644 --- a/src/lib/ui/post/Post.svelte +++ b/src/lib/ui/post/Post.svelte @@ -18,9 +18,8 @@ let post_context = undefined; let post = post_data; - let is_boost = false; - if (post_data.boost) { - is_boost = true; + let is_boost = !!post_data.boost; + if (is_boost) { post_context = post_data; post = post_data.boost; } @@ -28,6 +27,7 @@ function gotoPost() { if (focused) return; if (event.key && event.key !== "Enter") return; + console.log(`/post/${post.id}`); goto(`/post/${post.id}`); } diff --git a/src/lib/ui/post/ReplyContext.svelte b/src/lib/ui/post/ReplyContext.svelte index b328d3b..8a939f2 100644 --- a/src/lib/ui/post/ReplyContext.svelte +++ b/src/lib/ui/post/ReplyContext.svelte @@ -16,8 +16,8 @@ let aria_label = post.user.username + '; ' + post.text + '; ' + post.created_at; function gotoPost() { - if (focused) return; if (event.key && event.key !== "Enter") return; + console.log(`/post/${post.id}`); goto(`/post/${post.id}`); } diff --git a/src/routes/post/[id]/+page.svelte b/src/routes/post/[id]/+page.svelte index c583bd9..ec383ee 100644 --- a/src/routes/post/[id]/+page.svelte +++ b/src/routes/post/[id]/+page.svelte @@ -3,8 +3,8 @@ import Post from '$lib/ui/post/Post.svelte'; export let data; - const main_post = data.posts[0]; - const replies = data.posts.slice(1); + $: main_post = data.posts[0]; + $: replies = data.posts.slice(1);
@@ -13,11 +13,13 @@ just a moment...
{:else} + {#key data}
{#each replies as post} {/each} + {/key} {/if}