Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/components/charts/ChartsCatalogResult.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,12 @@ export function ChartsCatalogResult({
if (!trustedUrl) return
const currentHistory = previewHistoryRef.current
const currentUrl = currentHistory.entries[currentHistory.index] ?? '/'

setPreviewHistory((current) => {
const next = updateExamplePreviewHistory(current, {
kind: message.navigationKind,
url: trustedUrl,
})
previewHistoryRef.current = next
return next
const nextHistory = updateExamplePreviewHistory(currentHistory, {
kind: message.navigationKind,
url: trustedUrl,
})
previewHistoryRef.current = nextHistory
setPreviewHistory(nextHistory)
setPreviewNavigationError('')
if (message.navigationKind === 'load' || currentUrl !== trustedUrl) {
setPreviewAnnotationTarget(undefined)
Expand Down
13 changes: 5 additions & 8 deletions src/components/charts/ChartsNotebookPage.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -808,15 +808,12 @@ export function ChartsNotebookPage() {
if (!trustedUrl) return
const currentHistory = previewHistoryRef.current
const currentUrl = currentHistory.entries[currentHistory.index] ?? '/'

setPreviewHistory((current) => {
const next = updateExamplePreviewHistory(current, {
kind: message.navigationKind,
url: trustedUrl,
})
previewHistoryRef.current = next
return next
const nextHistory = updateExamplePreviewHistory(currentHistory, {
kind: message.navigationKind,
url: trustedUrl,
})
previewHistoryRef.current = nextHistory
setPreviewHistory(nextHistory)
setPreviewNavigationError('')
if (message.navigationKind === 'load' || currentUrl !== trustedUrl) {
setPreviewAnnotationTarget(undefined)
Expand Down
Loading