-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show warning in UI when duplicate installations of DevTools extension…
… are detected (#22563)
- Loading branch information
Juan
authored
Oct 15, 2021
1 parent
9d3d030
commit 930c9e7
Showing
6 changed files
with
115 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
packages/react-devtools-shared/src/devtools/views/DuplicateInstallationDialog.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow strict-local | ||
*/ | ||
|
||
import * as React from 'react'; | ||
import {Fragment, useContext, useEffect} from 'react'; | ||
import {isInternalFacebookBuild} from 'react-devtools-feature-flags'; | ||
import {ModalDialogContext} from './ModalDialog'; | ||
|
||
export default function DuplicateInstallationDialog(_: {||}) { | ||
const {dispatch} = useContext(ModalDialogContext); | ||
|
||
useEffect(() => { | ||
dispatch({ | ||
canBeDismissed: false, | ||
id: 'DuplicateInstallationDialog', | ||
type: 'SHOW', | ||
title: 'Duplicate Installations of DevTools Detected', | ||
content: <DialogContent />, | ||
}); | ||
}, []); | ||
return null; | ||
} | ||
|
||
function DialogContent(_: {||}) { | ||
return ( | ||
<Fragment> | ||
<p> | ||
We detected that there are multiple versions of React Developer Tools | ||
installed and enabled in your browser at the same time, which will cause | ||
issues while using the extension. | ||
</p> | ||
{isInternalFacebookBuild ? ( | ||
<p> | ||
Before proceeding, please ensure that the only enabled version of | ||
React Developer Tools is the internal (Chef-installed) version. To | ||
manage your extensions, visit the <code>about://extensions</code> page | ||
in your browser. | ||
</p> | ||
) : ( | ||
<p> | ||
Please ensure that you have installed and enabled only a single | ||
version of React Developer Tools before proceeding. To manage your | ||
extensions, visit the <code>about://extensions</code> page in your | ||
browser. | ||
</p> | ||
)} | ||
</Fragment> | ||
); | ||
} |