Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

Fix multiple dialog pop-ups (#501)

Guy Ben-Aharon041174286418
diff --git a/src/pages/editor-page/editor-page.tsx b/src/pages/editor-page/editor-page.tsx
index e210e207..eb65e6ca 100644
--- a/src/pages/editor-page/editor-page.tsx
+++ b/src/pages/editor-page/editor-page.tsx
@@ -160,11 +160,9 @@ const EditorPageComponent: React.FC = () => {
new Date().getTime() - starUsDialogLastOpen >
1000 * 60 * 60 * 24 * SHOW_STAR_US_AGAIN_AFTER_DAYS
) {
- setTimeout(() => {
- const lastOpen = new Date().getTime();
- setStarUsDialogLastOpen(lastOpen);
- openStarUsDialog();
- }, OPEN_STAR_US_AFTER_SECONDS * 1000);
+ const lastOpen = new Date().getTime();
+ setStarUsDialogLastOpen(lastOpen);
+ setTimeout(openStarUsDialog, OPEN_STAR_US_AFTER_SECONDS * 1000);
}
}, [
currentDiagram?.id,
@@ -189,11 +187,9 @@ const EditorPageComponent: React.FC = () => {
? SHOW_BUCKLE_AGAIN_OPENED_AFTER_DAYS
: SHOW_BUCKLE_AGAIN_AFTER_DAYS)
) {
- setTimeout(() => {
- const lastOpen = new Date().getTime();
- setBuckleDialogLastOpen(lastOpen);
- openBuckleDialog();
- }, OPEN_BUCKLE_AFTER_SECONDS * 1000);
+ const lastOpen = new Date().getTime();
+ setBuckleDialogLastOpen(lastOpen);
+ setTimeout(openBuckleDialog, OPEN_BUCKLE_AFTER_SECONDS * 1000);
}
}, [
currentDiagram?.id,