Skip to content

Commit

Permalink
Merge pull request #1819 from airqo-platform/NET-dev-tools
Browse files Browse the repository at this point in the history
[NET] Dev tools
  • Loading branch information
Baalmart authored Jan 22, 2024
2 parents 26c3820 + 7798b49 commit bd670f5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions netmanager/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ if (localStorage.jwtToken) {
}

const App = () => {
// disabling feature
useEffect(() => {
if (process.env.REACT_APP_ALLOW_DEV_TOOLS === 'staging') {
return;
} else {
// Disable context menu (right click)
document.addEventListener('contextmenu', (e) => {
e.preventDefault();
});

// Disable F12 key (open developer tools)
document.addEventListener('keydown', (e) => {
if (e.keyCode === 123) {
e.preventDefault();
}
});
}
}, []);

return (
<Provider store={store}>
<ThemeProvider theme={theme}>
Expand Down

0 comments on commit bd670f5

Please sign in to comment.