-
- {title !== null &&
{title}
}
- {content}
- {canBeDismissed && (
-
-
-
- )}
-
+
+ {title !== null &&
{title}
}
+ {content}
+ {canBeDismissed && (
+
+
+
+ )}
);
}
diff --git a/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingImportExportButtons.js b/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingImportExportButtons.js
index 7f14438aaa6ec..d6570dd5ab34b 100644
--- a/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingImportExportButtons.js
+++ b/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingImportExportButtons.js
@@ -85,6 +85,7 @@ export default function ProfilingImportExportButtons() {
);
} catch (error) {
modalDialogDispatch({
+ id: 'ProfilingImportExportButtons',
type: 'SHOW',
title: 'Import failed',
content: (
diff --git a/packages/react-devtools-shared/src/devtools/views/UnsupportedBridgeProtocolDialog.js b/packages/react-devtools-shared/src/devtools/views/UnsupportedBridgeProtocolDialog.js
index b5c1e7e8baeb9..ddbde14fad118 100644
--- a/packages/react-devtools-shared/src/devtools/views/UnsupportedBridgeProtocolDialog.js
+++ b/packages/react-devtools-shared/src/devtools/views/UnsupportedBridgeProtocolDialog.js
@@ -21,17 +21,21 @@ import type {BridgeProtocol} from 'react-devtools-shared/src/bridge';
const DEVTOOLS_VERSION = process.env.DEVTOOLS_VERSION;
const INSTRUCTIONS_FB_URL = 'https://fburl.com/devtools-bridge-protocol';
+const MODAL_DIALOG_ID = 'UnsupportedBridgeProtocolDialog';
export default function UnsupportedBridgeProtocolDialog(_: {||}) {
- const {dispatch, isVisible} = useContext(ModalDialogContext);
+ const {dialogs, dispatch} = useContext(ModalDialogContext);
const store = useContext(StoreContext);
+ const isVisible = !!dialogs.find(dialog => dialog.id === MODAL_DIALOG_ID);
+
useEffect(() => {
const updateDialog = () => {
if (!isVisible) {
if (store.unsupportedBridgeProtocol !== null) {
dispatch({
canBeDismissed: false,
+ id: MODAL_DIALOG_ID,
type: 'SHOW',
content: (
,
});
diff --git a/packages/react-devtools-shared/src/devtools/views/WarnIfLegacyBackendDetected.js b/packages/react-devtools-shared/src/devtools/views/WarnIfLegacyBackendDetected.js
index 12d88c0562205..4bc539d8975cd 100644
--- a/packages/react-devtools-shared/src/devtools/views/WarnIfLegacyBackendDetected.js
+++ b/packages/react-devtools-shared/src/devtools/views/WarnIfLegacyBackendDetected.js
@@ -31,6 +31,7 @@ export default function WarnIfLegacyBackendDetected(_: {||}) {
// Any of these types indicate the v3 backend.
dispatch({
canBeDismissed: false,
+ id: 'WarnIfLegacyBackendDetected',
type: 'SHOW',
title: 'DevTools v4 is incompatible with this version of React',
content:
,