prevent import of window

This commit is contained in:
Abhinav 2022-08-02 11:45:42 +05:30
parent 6132b2657a
commit 7acedc32a4
3 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,4 @@
import { Link, LinkProps } from '@mui/material';
import Link, { LinkProps } from '@mui/material/Link';
import React, { FC } from 'react';
import { ButtonProps } from 'react-bootstrap';

View file

@ -1,11 +1,10 @@
import { runningInBrowser } from 'utils/common';
import { logError } from 'utils/sentry';
class DesktopService {
private ElectronAPIs: any;
private allElectronAPIsExist: boolean = false;
constructor() {
this.ElectronAPIs = runningInBrowser() && window['ElectronAPIs'];
this.ElectronAPIs = globalThis['ElectronAPIs'];
this.allElectronAPIsExist = !!this.ElectronAPIs?.getEncryptionKey;
}

View file

@ -1,4 +1,5 @@
import { Box, Typography } from '@mui/material';
import Typography from '@mui/material/Typography';
import Box from '@mui/material/Box';
import Link from '@mui/material/Link';
import LinkButton from 'components/pages/gallery/LinkButton';
import React from 'react';
@ -395,7 +396,9 @@ const englishConstants = {
},
PHOTO_COUNT: (count: number) =>
`${
count === 1
!count
? 'No memory'
: count === 1
? `1 memory`
: `${formatNumberWithCommas(count)} memories`
}`,