check if on the web

This commit is contained in:
Rushikesh Tote 2022-06-13 12:23:15 +05:30
parent accf97c38b
commit 21c5af6752
2 changed files with 22 additions and 2 deletions

View file

@ -8,6 +8,8 @@ import { PAGES } from 'constants/pages';
import { useRouter } from 'next/router';
import { AppContext } from 'pages/_app';
import WatchModal from '../WatchModal';
import isElectron from 'is-electron';
import { downloadApp } from 'utils/common';
export default function UtilitySection({ closeSidebar }) {
const router = useRouter();
@ -24,7 +26,25 @@ export default function UtilitySection({ closeSidebar }) {
const openTwoFactorModalView = () => setTwoFactorModalView(true);
const closeTwoFactorModalView = () => setTwoFactorModalView(false);
const openWatchModalView = () => setWatchModalView(true);
const openWatchModalView = () => {
if (isElectron()) {
setWatchModalView(true);
} else {
setDialogMessage({
title: constants.DOWNLOAD_APP,
content: constants.DOWNLOAD_APP_MESSAGE(),
proceed: {
text: constants.DOWNLOAD,
action: downloadApp,
variant: 'success',
},
close: {
text: constants.CLOSE,
},
});
}
};
const redirectToChangePasswordPage = () => {
closeSidebar();

View file

@ -237,7 +237,7 @@ const englishConstants = {
DOWNLOAD_APP_MESSAGE: () => (
<>
<p>
Sorry, this operation is currently only supported on our desktop
Sorry, this feature is currently only supported on our desktop
app
</p>
</>