From 16fc9bc70e587f0e25ddd98db5db9465d2762846 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Sun, 16 Feb 2025 13:45:08 -0500 Subject: [PATCH] feat: Fetch categories and check for Immich integration on modal mount --- .../src/lib/components/AdventureModal.svelte | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/src/lib/components/AdventureModal.svelte b/frontend/src/lib/components/AdventureModal.svelte index 84c41a9..96648d7 100644 --- a/frontend/src/lib/components/AdventureModal.svelte +++ b/frontend/src/lib/components/AdventureModal.svelte @@ -89,6 +89,22 @@ onMount(async () => { modal = document.getElementById('my_modal_1') as HTMLDialogElement; modal.showModal(); + let categoryFetch = await fetch('/api/categories/categories'); + if (categoryFetch.ok) { + categories = await categoryFetch.json(); + } else { + addToast('error', $t('adventures.category_fetch_error')); + } + // Check for Immich Integration + let res = await fetch('/api/integrations'); + if (!res.ok) { + addToast('error', $t('immich.integration_fetch_error')); + } else { + let data = await res.json(); + if (data.immich) { + immichIntegration = true; + } + } }); let url: string = '';