fix: messed up redirects for http urls

This commit is contained in:
Xylight committed 2025-09-28 14:33:24 -07:00
1 parent a42644a042
commit fdcef736cf
7 files changed
+31 -27

No files matched your search

+2 -2
View File
@@ -599,12 +599,12 @@
"title": "Removing Submission", "title": "Removing Submission",
"titleRestore": "Restoring Submission", "titleRestore": "Restoring Submission",
"titlePurge": "Purging Submission", "titlePurge": "Purging Submission",
"withReason": "Notify user", "withReason": "Notify author",
"comment": "Comment", "comment": "Comment",
"message": "Message", "message": "Message",
"failReply": "Failed to post reply. Removing anyway...", "failReply": "Failed to post reply. Removing anyway...",
"failMessage": "Failed to message user. Removing anyway...", "failMessage": "Failed to message user. Removing anyway...",
"failEmptyReply": "Your reply cannot be empty if 'Notify user' is enabled.", "failEmptyReply": "Your reply cannot be empty if 'Notify author' is enabled.",
"successPurge": "Successfully purged that submission." "successPurge": "Successfully purged that submission."
}, },
"reportModal": { "reportModal": {
+4 -5
View File
@@ -6,7 +6,7 @@
import { t } from '$lib/app/i18n' import { t } from '$lib/app/i18n'
import { settings } from '$lib/app/settings.svelte' import { settings } from '$lib/app/settings.svelte'
import FormattedNumber from '$lib/ui/util/FormattedNumber.svelte' import FormattedNumber from '$lib/ui/util/FormattedNumber.svelte'
import { buttonColor, toast } from 'mono-svelte' import { toast } from 'mono-svelte'
import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons/dist' import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons/dist'
import { backOut } from 'svelte/easing' import { backOut } from 'svelte/easing'
import { fly } from 'svelte/transition' import { fly } from 'svelte/transition'
@@ -74,7 +74,7 @@
<button <button
onclick={() => castVote(vote == targetNum ? 0 : targetNum)} onclick={() => castVote(vote == targetNum ? 0 : targetNum)}
class={[ class={[
'flex items-center gap-0.5 transition-colors relative cursor-pointer h-full p-1.5', 'flex items-center gap-0.5 transition-colors relative cursor-pointer px-1.5 py-1',
'first:rounded-l-3xl last:rounded-r-3xl', 'first:rounded-l-3xl last:rounded-r-3xl',
'last:flex-row-reverse', 'last:flex-row-reverse',
vote == targetNum vote == targetNum
@@ -112,14 +112,13 @@
<div <div
class={[ class={[
'h-full relative flex items-center overflow-hidden rounded-full hover:bg-transparent font-medium hover:dark:bg-transparent', 'h-full relative flex items-center overflow-hidden rounded-full font-medium',
buttonColor.ghost,
voteRatio < 85 && settings.voteRatioBar && 'vote-ratio', voteRatio < 85 && settings.voteRatioBar && 'vote-ratio',
'divide-x divide-slate-200 dark:divide-zinc-800 border border-slate-200 dark:border-zinc-800',
]} ]}
style="--vote-ratio: {voteRatio}%;" style="--vote-ratio: {voteRatio}%;"
> >
{@render voteButton(upvotes, 'upvote', vote)} {@render voteButton(upvotes, 'upvote', vote)}
<div class="h-full p-0! border-l border-slate-200 dark:border-zinc-800"></div>
{#if site.data?.site_view.local_site.enable_downvotes ?? true} {#if site.data?.site_view.local_site.enable_downvotes ?? true}
{@render voteButton(downvotes, 'downvote', vote)} {@render voteButton(downvotes, 'downvote', vote)}
{/if} {/if}
+1 -1
View File
@@ -22,7 +22,7 @@
items, items,
item: itemSnippet, item: itemSnippet,
children, children,
animate = false, animate = true,
size = 'sm', size = 'sm',
class: clazz, class: clazz,
selected, selected,
+1 -1
View File
@@ -37,7 +37,7 @@
default: default:
'bg-white dark:bg-zinc-900 border border-slate-200 dark:border-zinc-800 border-b-slate-300 dark:border-t-zinc-700', 'bg-white dark:bg-zinc-900 border border-slate-200 dark:border-zinc-800 border-b-slate-300 dark:border-t-zinc-700',
distinct: distinct:
'bg-white dark:bg-zinc-900 border border-slate-200 dark:border-zinc-800 border-b-slate-300 dark:border-t-zinc-700', 'bg-white dark:bg-zinc-925 border border-slate-200 dark:border-zinc-900 border-b-slate-300 dark:border-t-zinc-800',
transparent: transparent:
'border border-slate-200 dark:border-zinc-900 border-b-slate-300 dark:border-t-zinc-800', 'border border-slate-200 dark:border-zinc-900 border-b-slate-300 dark:border-t-zinc-800',
uniform: uniform:
+1 -1
View File
@@ -7,7 +7,7 @@ export function load({ params }) {
redirect( redirect(
302, 302,
resolveRoute('/comment/[instance]/[id]', { resolveRoute('/comment/[instance]/[id]', {
instance: instance.data.toLowerCase(), instance: encodeURIComponent(instance.data.toLowerCase()),
id: params.instance, id: params.instance,
}), }),
) )
+1 -1
View File
@@ -23,7 +23,7 @@ export async function load({ params, fetch }) {
resolveRoute( resolveRoute(
`/post/[instance]/[id]?thread=${threadPath}#${comment.comment_view.comment.id}`, `/post/[instance]/[id]?thread=${threadPath}#${comment.comment_view.comment.id}`,
{ {
instance: params.instance, instance: encodeURIComponent(params.instance),
id: comment.comment_view.post.id.toString(), id: comment.comment_view.post.id.toString(),
}, },
), ),
+21 -16
View File
@@ -138,24 +138,29 @@
{/if} {/if}
{#if data.items?.value && data.items?.value.length > 0} {#if data.items?.value && data.items?.value.length > 0}
<CommonList items={data.items?.value} size="lg"> <CommonList items={data.items?.value} size="lg">
{#snippet item(item)} {#each data.items.value ?? [] as item}
<Material <svelte:element
rounding={item.length == 1 ? 'none' : '2xl'} this={item.length == 1 ? 'li' : 'div'}
color={item.length == 1 ? 'none' : 'uniform'} class="z-0 relative"
padding={item.length == 1 ? 'none' : 'md'}
class={['space-y-2 w-full']}
> >
<Report {item} />
</Material>
{#if item.length > 1}
<Material <Material
padding="none" rounding={item.length == 1 ? 'none' : '2xl'}
rounding="none" color={item.length == 1 ? 'none' : 'distinct'}
color="uniform" padding={item.length == 1 ? 'none' : 'md'}
class="-mt-3 rounded-b-2xl w-[95%] h-4 bg-slate-50! dark:bg-zinc-950!" class={['space-y-2 w-full z-10 relative']}
></Material> >
{/if} <Report {item} />
{/snippet} </Material>
{#if item.length > 1}
<Material
padding="none"
rounding="none"
color="uniform"
class="-mt-1 rounded-b-2xl w-[97%] h-6 opacity-70 left-1/2 -translate-x-1/2 -z-10 relative"
></Material>
{/if}
</svelte:element>
{/each}
</CommonList> </CommonList>
<Fixate placement="bottom"> <Fixate placement="bottom">
<Pageination <Pageination