wirking on global error display

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-09-26 14:45:19 +02:00
parent 9c4c71f7dd
commit 2a6392cd2b
14 changed files with 113 additions and 116 deletions

View File

@@ -3,14 +3,14 @@
import Bookmark from './Template.svelte';
import { api } from '../../urls.svelte.js';
import { t } from '../../translations.svelte.js';
import { api } from '../../urls.svelte';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte';
import Editor from '../../Components/MarkdownEditor.svelte';
import Editor from '../../Components/MarkdownEditor.svelte';
import Template from './Template.svelte';
let bookmark = $state(null);
let error = $state(null);
let { id } = $props();
async function load(){
@@ -18,15 +18,13 @@
const resp = await fetch(url,{credentials:'include'});
if (resp.ok){
bookmark = await resp.json();
yikes();
} else {
error = await resp.text();
error(await resp.text());
}
}
onMount(load);
</script>
{#if error}
<span class="error">{error}</span>
{/if}
<Template {bookmark} />