Revert "feat: add customizable keyboard navigation"

This commit is contained in:
Xylight authored and GitHub committed 2025-08-15 06:31:23 -07:00
1 parent 4e7c37bd89
commit f9a6e775f3
17 files changed
+39 -306

No files matched your search

@@ -2,7 +2,7 @@
import { profile } from '$lib/auth.svelte.js'
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { t } from '$lib/i18n/translations'
import { client } from '$lib/lemmy.svelte'
import { getClient } from '$lib/lemmy.svelte'
import { buttonColor, toast } from 'mono-svelte'
import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons'
import { backOut } from 'svelte/easing'
@@ -24,37 +24,18 @@
commentId,
}: Props = $props()
export const castVote = async (newVote: number) => {
const castVote = async (newVote: number) => {
if (!profile.current?.jwt) {
toast({ content: $t('toast.loginVoteGate'), type: 'warning' })
return
}
switch (vote ?? 0) {
case 0:
// nothing was removed
if (newVote == 1) upvotes++
else downvotes++
break
case 1:
// removed an upvote
upvotes--
if (newVote == -1) downvotes++
break
case -1:
// removed a downvote
downvotes--
if (newVote == 1) upvotes++
break
}
vote = newVote
client()
.likeComment({
comment_id: commentId,
score: vote,
})
.then(res => ({ upvotes, downvotes } = res.comment_view.counts))
const res = await getClient().likeComment({
comment_id: commentId,
score: vote,
})
;({ upvotes, downvotes } = res.comment_view.counts)
}
let voteRatio = $derived(