Make sure the sharing url is up-to-date before switch from editor to preview
This commit is contained in:
parent
f72b7f2f56
commit
e1b7961f45
|
@ -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)
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class={cssClass}>
|
||||
|
@ -116,9 +122,9 @@
|
|||
</button>
|
||||
|
||||
<!-- Switch to readonly view -->
|
||||
<a class="button" href={$shareUrl}>
|
||||
<button class="button" on:click={goToPreview}>
|
||||
<Icon class="text-xl" icon="fluent:eye-12-regular" />
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user