Skip to content

Commit

Permalink
Update SanityLive.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Nov 21, 2024
1 parent 46d3f71 commit 396cf2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions next-enterprise/src/app/SanityLive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ export function SanityLive() {
if (event.type === 'welcome') {
console.info('Sanity is live with automatic refresh of published content')
} else if (event.type === 'message') {
console.log('<SanityLive> schedule refresh')
setTimeout(() => {
if (signal.aborted) return
router.refresh()
console.log('<SanityLive> refreshing')
}, 1_000)
} else if (event.type === 'restart') {
router.refresh()
Expand Down

0 comments on commit 396cf2e

Please sign in to comment.