Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit e14ecfd

Browse files
authored
Merge pull request #4205 from withspectrum/2.4.63
2.4.63
2 parents e3558cb + 1118980 commit e14ecfd

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Spectrum",
3-
"version": "2.4.62",
3+
"version": "2.4.63",
44
"license": "BSD-3-Clause",
55
"devDependencies": {
66
"@babel/preset-flow": "^7.0.0",

src/helpers/is-os.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
// @flow
2-
export const isMac = () =>
3-
navigator && navigator.platform.toUpperCase().indexOf('MAC') >= 0;
2+
export const isMac = (): boolean => {
3+
try {
4+
return (
5+
navigator &&
6+
!!navigator.platform &&
7+
!!(navigator.platform.toUpperCase().indexOf('MAC') >= 0)
8+
);
9+
} catch (err) {
10+
return false;
11+
}
12+
};

src/views/dashboard/components/desktopAppUpsell/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ class DesktopAppUpsell extends React.Component<{}, State> {
2929
super();
3030

3131
this.state = {
32-
isVisible: isMac() && !isDesktopApp() && !hasDismissedDesktopAppUpsell(),
32+
isVisible: false,
3333
};
3434
}
3535

3636
componentDidMount() {
37-
const { isVisible } = this.state;
37+
const desktopUpsellVisible =
38+
isMac() && !isDesktopApp() && !hasDismissedDesktopAppUpsell();
3839

39-
if (isVisible) {
40+
if (desktopUpsellVisible) {
41+
this.setState({ isVisible: true });
4042
track(events.INBOX_DOWNLOAD_MAC_VIEWED);
4143
}
4244
}

src/views/thread/components/desktopAppUpsell/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ class DesktopAppUpsell extends React.Component<{}, State> {
2121
super();
2222

2323
this.state = {
24-
isVisible: isMac() && !isDesktopApp() && !hasDismissedDesktopAppUpsell(),
24+
isVisible: false,
2525
};
2626
}
2727

2828
componentDidMount() {
29-
const { isVisible } = this.state;
29+
const desktopUpsellVisible =
30+
isMac() && !isDesktopApp() && !hasDismissedDesktopAppUpsell();
3031

31-
if (isVisible) {
32+
if (desktopUpsellVisible) {
33+
this.setState({ isVisible: true });
3234
track(events.THREAD_VIEW_DOWNLOAD_MAC_VIEWED);
3335
}
3436
}

0 commit comments

Comments
 (0)