bug fixes

This commit is contained in:
Christian Beutel
2025-01-03 18:59:10 +01:00
parent 46b5b94219
commit 72d2bf6062
17 changed files with 1140 additions and 24 deletions

View File

@@ -1,7 +1,9 @@
<script>
import { page } from "$app/stores";
</script>
<svelte:head>
<title>{$page.status} | wanderer</title>
</svelte:head>
<div
class="flex flex-col gap-y-4 items-center justify-center relative"
style="height: calc(100dvh - 120px); font-size: 4rem"

View File

@@ -7,8 +7,7 @@
let loading: boolean = false;
const key: "follower" | "followee" =
$page.params.type == "following" ? "followee" : "follower";
$: key = ($page.params.type == "following" ? "followee" : "follower") as "follower" | "followee";
$: pagination = {
page: data.follows.page,

View File

@@ -35,27 +35,27 @@
const notificationItems: { text: string; key: NotificationType }[] = [
{
text: $_("notification-trail-comment"),
text: $_("settings-notification-trail-comment"),
key: NotificationType.trailComment,
},
{
text: $_("notification-new-follower"),
text: $_("settings-notification-new-follower"),
key: NotificationType.newFollower,
},
{
text: $_("notification-trail-create"),
text: $_("settings-notification-trail-create"),
key: NotificationType.trailCreate,
},
{
text: $_("notification-trail-share"),
text: $_("settings-notification-trail-share"),
key: NotificationType.trailShare,
},
{
text: $_("notification-list-create"),
text: $_("settings-notification-list-create"),
key: NotificationType.listCreate,
},
{
text: $_("notification-list-share"),
text: $_("settings-notification-list-share"),
key: NotificationType.listShare,
},
];

View File

@@ -1,6 +1,6 @@
import { trails_show } from "$lib/stores/trail_store";
import { APIError } from "$lib/util/api_util";
import { error, type Load } from "@sveltejs/kit";
import { error, type Load, type NumericRange } from "@sveltejs/kit";
export const load: Load = async ({ params, fetch }) => {
try {
@@ -8,9 +8,9 @@ export const load: Load = async ({ params, fetch }) => {
return { trail }
} catch (e) {
if (e instanceof APIError && e.status == 404) {
error(404, {
message: 'Not found'
if (e instanceof APIError) {
error(e.status as NumericRange<400, 599>, {
message: e.status == 404 ? 'Not found' : e.message
});
}
console.log(e);