Skip to content

Commit

Permalink
fix: wait for title before updating announcer
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrich committed Jul 10, 2023
1 parent 61c3e5a commit 3d9378d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/kit/src/core/sync/write_root.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function write_root(manifest_data, output) {
dedent`
<!-- This file is generated by @sveltejs/kit — do not edit it! -->
<script>
import { setContext, afterUpdate, onMount } from 'svelte';
import { setContext, afterUpdate, onMount, tick } from 'svelte';
import { browser } from '$app/environment';
// stores
Expand All @@ -67,7 +67,9 @@ export function write_root(manifest_data, output) {
const unsubscribe = stores.page.subscribe(() => {
if (mounted) {
navigated = true;
title = document.title || 'untitled page';
tick().then(() => {
title = document.title || 'untitled page';
});
}
});
Expand Down

0 comments on commit 3d9378d

Please sign in to comment.