check if on the web
This commit is contained in:
parent
accf97c38b
commit
21c5af6752
|
@ -8,6 +8,8 @@ import { PAGES } from 'constants/pages';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { AppContext } from 'pages/_app';
|
import { AppContext } from 'pages/_app';
|
||||||
import WatchModal from '../WatchModal';
|
import WatchModal from '../WatchModal';
|
||||||
|
import isElectron from 'is-electron';
|
||||||
|
import { downloadApp } from 'utils/common';
|
||||||
|
|
||||||
export default function UtilitySection({ closeSidebar }) {
|
export default function UtilitySection({ closeSidebar }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -24,7 +26,25 @@ export default function UtilitySection({ closeSidebar }) {
|
||||||
const openTwoFactorModalView = () => setTwoFactorModalView(true);
|
const openTwoFactorModalView = () => setTwoFactorModalView(true);
|
||||||
const closeTwoFactorModalView = () => setTwoFactorModalView(false);
|
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 = () => {
|
const redirectToChangePasswordPage = () => {
|
||||||
closeSidebar();
|
closeSidebar();
|
||||||
|
|
|
@ -237,7 +237,7 @@ const englishConstants = {
|
||||||
DOWNLOAD_APP_MESSAGE: () => (
|
DOWNLOAD_APP_MESSAGE: () => (
|
||||||
<>
|
<>
|
||||||
<p>
|
<p>
|
||||||
Sorry, this operation is currently only supported on our desktop
|
Sorry, this feature is currently only supported on our desktop
|
||||||
app
|
app
|
||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in a new issue