We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
show()
1 parent 8b0c374 commit 8ab4bfaCopy full SHA for 8ab4bfa
2 files changed
packages/react-dialog-async/package.json
@@ -2,7 +2,7 @@
2
"name": "react-dialog-async",
3
"description": "A promise-based way to show dialogs in React",
4
"type": "module",
5
- "version": "2.3.1",
+ "version": "2.3.2",
6
"sideEffects": false,
7
"main": "index.js",
8
"module": "index.esm.js",
packages/react-dialog-async/src/DialogProvider/DialogProvider.tsx
@@ -65,6 +65,9 @@ const DialogProvider = ({
65
data: unknown,
66
unmountDelay?: number,
67
): Promise<unknown> => {
68
+ // if already open, do nothing
69
+ if (dialogState[id]?.open) return Promise.resolve();
70
+
71
return new Promise((resolve) => {
72
if (unmountDelayTimeoutRefs.current[id] !== undefined) {
73
clearTimeout(unmountDelayTimeoutRefs.current[id]);
0 commit comments