diff --git a/bun.lockb b/bun.lockb
index 8a6fb3e3..4b14df82 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 2b39519c..2f3343da 100644
--- a/package.json
+++ b/package.json
@@ -26,7 +26,7 @@
"postcss": "^8.4.30",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
- "svelte": "^5.19.7",
+ "svelte": "^5.34.8",
"svelte-adapter-bun-next": "^1.0.3",
"svelte-check": "^4.0.0",
"svelte-floating-ui": "^1.5.9",
@@ -43,7 +43,7 @@
"vite": "^5.4.14"
},
"overrides": {
- "svelte": "^5.19.7"
+ "svelte": "^5.34.8"
},
"private": true,
"scripts": {
diff --git a/src/lib/components/lemmy/comment/CommentForm.svelte b/src/lib/components/lemmy/comment/CommentForm.svelte
index 37ef8cf0..c27c7236 100644
--- a/src/lib/components/lemmy/comment/CommentForm.svelte
+++ b/src/lib/components/lemmy/comment/CommentForm.svelte
@@ -20,6 +20,7 @@
placeholder?: string | undefined
value?: string
actions?: boolean
+ tools?: boolean
preview?: boolean
class?: ClassValue
required?: boolean
diff --git a/src/lib/components/lemmy/comment/Comments.svelte b/src/lib/components/lemmy/comment/Comments.svelte
index a989b4f6..39c6ec35 100644
--- a/src/lib/components/lemmy/comment/Comments.svelte
+++ b/src/lib/components/lemmy/comment/Comments.svelte
@@ -104,8 +104,8 @@
{#each nodes as node, index (node.comment_view.comment.id)}
import { settings } from '$lib/settings.svelte.js'
import type { Snippet } from 'svelte'
- import type { ClassValue, UIEventHandler } from 'svelte/elements'
+ import type { ClassValue, HTMLAttributes, UIEventHandler } from 'svelte/elements'
import { scrollY } from 'svelte/reactivity/window'
- interface Props {
+ interface Props extends HTMLAttributes {
route?: { id: string | null } | undefined
class?: ClassValue
children?: Snippet
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index dc3b8a13..663aade7 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -943,7 +943,8 @@
"language_not_allowed": "That language isn't allowed in this community. Unset it to use the community's default.",
"couldnt_find_person": "That user doesn't exist.",
"couldnt_find_community": "That community doesn't exist.",
- "not_an_admin": "You are not an admin of this instance."
+ "not_an_admin": "You are not an admin of this instance.",
+ "rate_limit_error": "You are performing that action too fast."
},
"aria": {
"pagination": {
diff --git a/src/lib/mono/toast/toasts.ts b/src/lib/mono/toast/toasts.ts
index a85b59ef..22c7cb9a 100644
--- a/src/lib/mono/toast/toasts.ts
+++ b/src/lib/mono/toast/toasts.ts
@@ -43,7 +43,7 @@ export function toast({
let id = 0
toasts.update(toasts => {
- id = Math.floor(Math.random() * 10000)
+ id = Math.max(...toasts.map(t => t.id)) + 1
return [
...toasts,
diff --git a/src/routes/post/[instance]/[id=integer]/+page.svelte b/src/routes/post/[instance]/[id=integer]/+page.svelte
index 88b5a88e..a3597a84 100644
--- a/src/routes/post/[instance]/[id=integer]/+page.svelte
+++ b/src/routes/post/[instance]/[id=integer]/+page.svelte
@@ -34,13 +34,6 @@
let { data } = $props()
- // hack to fix effect bug
- // TODO find cause
- let comments = $state(data.comments)
- $effect(() => {
- comments = data.comments
- })
-
onMount(async () => {
if (
!(data.post.value.post_view.read && settings.markPostsAsRead) &&
@@ -64,7 +57,7 @@
async function reloadComments() {
loading = true
- comments = getClient().getComments({
+ data.comments.value = getClient().getComments({
page: 1,
limit: 25,
type_: 'All',
@@ -248,7 +241,7 @@
{/if}
- {#await comments}
+ {#await data.comments.value}
{#each new Array(10) as _, index}
{_}
diff --git a/src/routes/post/[instance]/[id=integer]/+page.ts b/src/routes/post/[instance]/[id=integer]/+page.ts
index 1d72d482..8607f102 100644
--- a/src/routes/post/[instance]/[id=integer]/+page.ts
+++ b/src/routes/post/[instance]/[id=integer]/+page.ts
@@ -62,7 +62,7 @@ export async function load({ params, url, fetch }) {
}),
post: new ReactiveState(post),
commentSort: new ReactiveState(sort),
- comments: (await awaitIfServer(comments)).data,
+ comments: new ReactiveState((await awaitIfServer(comments)).data),
slots: {
sidebar: {
component: CommunityCard,
diff --git a/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte b/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte
index ac6de6df..4ac6da08 100644
--- a/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte
+++ b/src/routes/post/[instance]/[id=integer]/CommentProvider.svelte
@@ -40,9 +40,10 @@
focus,
virtualize = true,
}: Props = $props()
- let comments = $state(passedComments)
-
let commenting = $state(false)
+
+ let comments = $derived(passedComments)
+
let tree = $state(buildCommentsTree(comments.comments))
$effect(() => {
tree = buildCommentsTree(comments.comments)
@@ -144,7 +145,7 @@
{:else}
{/if}