Skip to content

Commit

Permalink
refactor(structure): add timeout for reconnecting pane provider
Browse files Browse the repository at this point in the history
  • Loading branch information
RitaDias committed Sep 24, 2024
1 parent a218c88 commit 9a5d0d1
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,13 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {

useEffect(() => {
if (connectionState === 'reconnecting') {
pushToast({
id: 'sanity/structure/reconnecting',
status: 'warning',
title: t('panes.document-pane-provider.reconnecting.title'),
})
setTimeout(() => {
pushToast({
id: 'sanity/structure/reconnecting',
status: 'warning',
title: t('panes.document-pane-provider.reconnecting.title'),
})
}, 2000)
}
}, [connectionState, pushToast, t])

Expand Down

0 comments on commit 9a5d0d1

Please sign in to comment.