From 9a5d0d12287b5eaec096a8e14a950ee898f38055 Mon Sep 17 00:00:00 2001 From: Rita Date: Fri, 20 Sep 2024 11:18:04 +0200 Subject: [PATCH] refactor(structure): add timeout for reconnecting pane provider --- .../panes/document/DocumentPaneProvider.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx b/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx index 4660477811c..e94fbef5609 100644 --- a/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx +++ b/packages/sanity/src/structure/panes/document/DocumentPaneProvider.tsx @@ -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])