From e1b7961f456269a32e1f7356aab642a26cfb8bdf Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Sat, 25 Nov 2023 08:37:17 +0100 Subject: [PATCH] Make sure the sharing url is up-to-date before switch from editor to preview --- src/components/EditForm.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/EditForm.svelte b/src/components/EditForm.svelte index 7e44c13..1b31b9f 100644 --- a/src/components/EditForm.svelte +++ b/src/components/EditForm.svelte @@ -5,6 +5,7 @@ import { shareUrl, selectedLang } from '../store' import ComboBox from './ComboBox.svelte' import Icon from '@iconify/svelte' + import { goto } from '$app/navigation' type Language = { text: string @@ -80,6 +81,11 @@ function closeUrlInput() { isUrlInputVisible = false } + + async function goToPreview() { + await updateShareUrl() + goto($shareUrl) + }
@@ -116,9 +122,9 @@ - +
{/if}