fix: ssr redirect issue

This commit is contained in:
Xylight committed 2024-03-15 14:34:51 -07:00
1 parent a505bd5b64
commit ae0657cf7c
9 files changed
+101 -63

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "photon-lemmy", "name": "photon-lemmy",
"version": "1.28.3", "version": "1.28.4",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
+80 -32
View File
@@ -12,13 +12,7 @@
<h1 class="text-2xl font-bold leading-8">About</h1> <h1 class="text-2xl font-bold leading-8">About</h1>
<p class="my-3"> <p class="my-3">
<strong>Photon</strong> <strong>Photon</strong>
is a client for is a replacement user interface for Lemmy, with more features and modern design.
<a href="https://join-lemmy.org" class="underline">Lemmy</a>
that is meant to replace the default lemmy-ui.
</p>
<p class="my-3">
It's named that because some random person in a Discord server said that
would be a good name. Great choice, I know.
</p> </p>
<h1 class="text-2xl font-bold leading-8">Links</h1> <h1 class="text-2xl font-bold leading-8">Links</h1>
<ul class="list-disc pl-4 my-3"> <ul class="list-disc pl-4 my-3">
@@ -40,42 +34,96 @@
<Link href="https://buymeacoffee.com/xylight" highlight>Donate</Link> <Link href="https://buymeacoffee.com/xylight" highlight>Donate</Link>
</li> </li>
</ul> </ul>
<h1 class="text-2xl font-bold leading-8">Credits</h1> <h1 class="text-2xl font-bold leading-10">Credits</h1>
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4"> <div class="flex flex-row flex-wrap gap-6 items-center w-full">
<Profile name="Xylight" description="Main developer" />
<Profile <Profile
avatar="https://lemmy.xylight.dev/pictrs/image/3281f13c-68bb-47c9-8c98-b67f67714d5a.png?format=webp&thumbnail=128" name="Cole"
description="Main developer" badge="lemdro.id"
name="Xylight" description="Contributor"
class="sm:col-span-3 place-self-center" link="/u/cole@lemdro.id"
link="https://xylight.dev" />
<Profile
name="iJeff"
badge="lemdro.id"
description="Contributor"
link="/u/ijeff@lemdro.id"
/> />
<hr class="border-slate-200 dark:border-zinc-800 w-full sm:col-span-3" />
<Profile <Profile
description="Early contributor"
name="pbui" name="pbui"
description="Contributor"
link="https://github.com/pbui" link="https://github.com/pbui"
/> />
<Profile <Profile
description="Early supporter" name="Neshura87"
name="iJeff of lemdro.id" description="Contributor"
link="https://lemdro.id/u/ijeff" link="https://github.com/neshura87"
/> />
<Profile <Profile
description="Early contributor" name="Pieterdd"
name="Cole of lemdro.id" description="Contributor"
link="https://lemdro.id/u/cole" link="https://github.com/pieterdd"
/> />
<Profile <Profile
description="Big supporter" name="0xCmdrKeen"
name="lemmy.world team" description="Contributor"
link="https://lemmy.world" link="https://github.com/0xCmdrKeen"
/> />
<Profile description="Massive donator" name="rooki" /> <Profile
<Profile description="Programming help" name="Sheodox" /> name="sant0s12"
<Profile description="Design inspiration" name="ljdawson" /> description="Contributor"
</div> link="https://github.com/sant0s12"
<div class="mt-4"> />
If you've contributed in any way and aren't mentioned here, please let me <Profile
know and I'll add you here ASAP. name="tfaughnan"
description="Contributor"
link="https://github.com/tfaughnan"
/>
<Profile
name="paradox460"
description="Contributor"
link="https://github.com/paradox460"
/>
<Profile
name="ngn13"
description="Contributor"
link="https://github.com/ngn13"
/>
<Profile
name="Tmpod"
description="Contributor"
link="https://github.com/Tmpod"
/>
<Profile
name="Xusontha"
description="Contributor"
link="https://github.com/Xusontha"
/>
<Profile
name="TheSaneWriter"
description="Contributor"
link="https://github.com/TheSaneWriter"
/>
<Profile
name="ZhenyaPav"
description="Contributor"
link="https://github.com/ZhenyaPav"
/>
<Profile
name="zamuz"
description="Contributor"
link="https://github.com/zamuz"
/>
<Profile
name="danielwolbach"
description="Contributor"
link="https://github.com/danielwolbach"
/>
<Profile
name="danielwolbach"
description="Contributor"
link="https://github.com/danielwolbach"
/>
<span>...and you, for using this app!</span>
</div> </div>
</div> </div>
+14 -24
View File
@@ -1,34 +1,24 @@
<script lang="ts"> <script lang="ts">
export let avatar: string | undefined = undefined import { Badge } from 'mono-svelte'
export let name: string export let name: string
export let description: string export let description: string
export let badge: string | undefined = undefined
export let link: string = '#' export let link: string = '#'
</script> </script>
<div class="flex flex-row items-center gap-2 {$$props.class}"> <div class="flex flex-col w-max {$$props.class}">
{#if $$slots.avatar || avatar} <a
{#if $$slots.avatar} href={link}
<slot name="avatar" /> class="text-base font-medium inline-flex items-center gap-2 {link != '#'
{:else} ? 'hover:underline'
<img : ''}"
src={avatar} >
alt="{name}'s profile" {name}
width={40} {#if badge}
height={40} <Badge color="gray-subtle" class="!p-0.5 !px-2">{badge}</Badge>
class="w-10 h-10 rounded-full"
/>
{/if} {/if}
{/if} </a>
<div class="flex flex-col"> <span class="text-sm">{description}</span>
<a
href={link}
class="font-semibold text-lg"
class:hover:underline={link != '#'}
>
{name}
</a>
<span class="text-slate-700 dark:text-zinc-300">{description}</span>
</div>
</div> </div>
+1 -1
View File
@@ -1,5 +1,5 @@
import { redirect } from '@sveltejs/kit' import { redirect } from '@sveltejs/kit'
export const load = () => { export const load = () => {
redirect(300, '/admin/config'); redirect(302, '/admin/config');
} }
+1 -1
View File
@@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit'
export function load({ params }) { export function load({ params }) {
// If you somehow got to /comment/instance, it likely means you passed in an ID, not an instance. // If you somehow got to /comment/instance, it likely means you passed in an ID, not an instance.
redirect(300, `/comment/${getInstance()}/${params.instance}`); redirect(302, `/comment/${getInstance()}/${params.instance}`);
} }
+1 -1
View File
@@ -9,7 +9,7 @@ export async function load({ params, fetch }) {
}) })
redirect( redirect(
300, 302,
`/post/${params.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}` `/post/${params.instance}/${comment.comment_view.post.id}?thread=${comment.comment_view.comment.path}#${comment.comment_view.comment.id}`
); );
} }
+1 -1
View File
@@ -12,7 +12,7 @@ export function load({ params, url }) {
const newUrl = new URL(url) const newUrl = new URL(url)
newUrl.pathname = split.join('/') newUrl.pathname = split.join('/')
redirect(300, newUrl.toString()); redirect(302, newUrl.toString());
} }
error(404, 'Not found'); error(404, 'Not found');
+1 -1
View File
@@ -1,5 +1,5 @@
import { redirect } from '@sveltejs/kit' import { redirect } from '@sveltejs/kit'
export const load = async () => { export const load = async () => {
redirect(300, '/profile/user'); redirect(302, '/profile/user');
} }
+1 -1
View File
@@ -3,6 +3,6 @@ import { redirect } from "@sveltejs/kit";
export const load = () => { export const load = () => {
if (LINKED_INSTANCE_URL) { if (LINKED_INSTANCE_URL) {
redirect(300, `/signup/${LINKED_INSTANCE_URL}`); redirect(302, `/signup/${LINKED_INSTANCE_URL}`);
} }
} }