diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 29dc2a9ce..d87a12299 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@tonkeeper/desktop", "license": "Apache-2.0", - "version": "3.13.0", + "version": "3.14.0", "description": "Your desktop wallet on The Open Network", "main": ".webpack/main", "repository": { diff --git a/apps/desktop/src/index.ts b/apps/desktop/src/index.ts index 8aa6a478c..51508d78b 100644 --- a/apps/desktop/src/index.ts +++ b/apps/desktop/src/index.ts @@ -1,5 +1,6 @@ import { initialize as aptabaseInitialize } from '@aptabase/electron/main'; -import { BrowserWindow, app } from 'electron'; +import { delay } from '@tonkeeper/core/dist/utils/common'; +import { BrowserWindow, app, powerMonitor } from 'electron'; import log from 'electron-log/main'; import { updateElectronApp } from 'update-electron-app'; import { MainWindow } from './electron/mainWindow'; @@ -21,8 +22,21 @@ if (require('electron-squirrel-startup')) { } const connection = TonConnectSSE.getInstance(); -app.on('before-quit', e => { + +const onUnLock = () => { + log.info('unlock-screen'); + connection.reconnect(); +}; +powerMonitor.on('unlock-screen', onUnLock); + +app.on('before-quit', async e => { + e.preventDefault(); connection.destroy(); + + powerMonitor.off('unlock-screen', onUnLock); + + await delay(100); + app.exit(); }); setDefaultProtocolClient(); diff --git a/apps/extension/package.json b/apps/extension/package.json index f4f454e7c..400c50dfb 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -1,6 +1,6 @@ { "name": "@tonkeeper/extension", - "version": "3.13.0", + "version": "3.14.0", "author": "Ton APPS UK Limited ", "description": "Your extension wallet on The Open Network", "dependencies": { diff --git a/apps/web/package.json b/apps/web/package.json index 30d7c1817..cf68ce3cb 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "@tonkeeper/web", - "version": "3.13.0", + "version": "3.14.0", "author": "Ton APPS UK Limited ", "description": "Your web wallet on The Open Network", "dependencies": {