fixes
Deploy to Cloudflare Pages / deploy (push) Successful in 1m8s

This commit is contained in:
2026-08-24 10:14:10 +07:00 Unverified
parent ffa9b10cd3
commit a5c648c6e0
3 changed files with 10 additions and 7 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { page } from "$app/state";
import { resolve } from "$app/paths";
import { getCameraController } from "$lib/camera-context";
import { cn } from "$lib/utils";
import ScanIcon from "@lucide/svelte/icons/scan-search";
@@ -13,7 +14,7 @@
event.preventDefault();
const imageDataUrl = cameraController.capture();
await goto("/app/list/manual", {
await goto(resolve("/app/list/manual"), {
state: imageDataUrl ? { imageDataUrl } : {},
});
}
@@ -24,7 +25,7 @@
"flex flex-col gap-1 items-center rounded-full bg-blue-500 text-white p-3 transition-colors",
selected && "dark:bg-white bg-black dark:text-blue-500",
)}
href="/app/scan"
href={resolve("/app/scan")}
onclick={handleClick}
>
<ScanIcon />
+5 -4
View File
@@ -1,5 +1,6 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { afterNavigate, goto } from "$app/navigation";
import { resolve } from "$app/paths";
import { page } from "$app/state";
import Image from "$lib/components/image.svelte";
import Badge from "$lib/components/ui/badge/badge.svelte";
@@ -114,7 +115,7 @@
await analyzeImage(file);
}
$effect(() => {
afterNavigate(() => {
const imageDataUrl = page.state.imageDataUrl;
if (imageDataUrl) void analyzeImage(imageDataUrl);
});
@@ -140,7 +141,7 @@
})),
);
await getItems().refresh();
goto("/app/list");
goto(resolve("/app/list"));
} catch (error) {
console.error(error);
errorMessage = $_("message.save_failed");
@@ -210,7 +211,7 @@
>
{:else}
<div class="flex flex-col gap-3">
{#each drafts as draft}
{#each drafts as draft (draft)}
<div class="flex items-start gap-3 rounded-md border p-3">
<Switch bind:checked={draft.include} class="mt-1" />
<div
+2 -1
View File
@@ -2,11 +2,12 @@
import Camera from "$lib/components/camera.svelte";
import { getCameraController } from "$lib/camera-context";
import SwitchCamera from "@lucide/svelte/icons/switch-camera";
import { onMount } from "svelte";
const cameraController = getCameraController();
let camera = $state<Camera>();
$effect(() => {
onMount(() => {
const currentCamera = camera;
if (!currentCamera) return;