From 951cb9ed6aa727c4aa5c8b59ee54d01bccff7aca Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 9 Apr 2020 16:59:19 +0300 Subject: [PATCH] popup new block --- electron.js | 2 ++ src/ts/app.tsx | 4 ++++ src/ts/component/page/auth/pin/check.tsx | 4 +++- src/ts/component/popup/new.tsx | 6 +++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/electron.js b/electron.js index e8b34f2597..e03792234b 100644 --- a/electron.js +++ b/electron.js @@ -149,6 +149,8 @@ function createWindow () { }); autoUpdater.on('update-not-available', (info) => { setStatus('Update not available'); + + win.webContents.send('update'); }); autoUpdater.on('error', (err) => { setStatus('Error: ' + err); }); autoUpdater.on('download-progress', (progress) => { diff --git a/src/ts/app.tsx b/src/ts/app.tsx index d5e9b9dfb9..ac77e62572 100644 --- a/src/ts/app.tsx +++ b/src/ts/app.tsx @@ -261,6 +261,10 @@ class App extends React.Component { }); }); + ipcRenderer.on('update', (e: any) => { + Storage.delete('popupNewBlock'); + }); + win.unbind('mousemove.common').on('mousemove.common', throttle((e: any) => { keyboard.setPinCheck(); keyboard.disableMouse(false); diff --git a/src/ts/component/page/auth/pin/check.tsx b/src/ts/component/page/auth/pin/check.tsx index 958caf6178..68cee368b6 100644 --- a/src/ts/component/page/auth/pin/check.tsx +++ b/src/ts/component/page/auth/pin/check.tsx @@ -99,7 +99,9 @@ class PageAuthPinCheck extends React.Component { history.push('/main/index'); }; - commonStore.popupOpen('new', {}); + if (!Storage.get('popupNewBlock')) { + commonStore.popupOpen('new', {}); + }; }); }; } else { diff --git a/src/ts/component/popup/new.tsx b/src/ts/component/popup/new.tsx index 3c2625258d..fddb6e677a 100644 --- a/src/ts/component/popup/new.tsx +++ b/src/ts/component/popup/new.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import { Label, Icon } from 'ts/component'; -import { I, Docs } from 'ts/lib'; +import { I, Docs, Storage } from 'ts/lib'; import { commonStore } from 'ts/store'; import { observer } from 'mobx-react'; @@ -40,6 +40,10 @@ class PopupNew extends React.Component { ); }; + componentDidMount () { + Storage.set('popupNewBlock', 1); + }; + onUrl (url: string) { ipcRenderer.send('urlOpen', url); };