Skip to content

Commit

Permalink
Merge pull request #100 from tonkeeper/feature/desktop
Browse files Browse the repository at this point in the history
Reconnect after sleep
  • Loading branch information
KuznetsovNikita authored Jun 6, 2024
2 parents 7f60866 + 5beeba7 commit 7a3d456
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
18 changes: 16 additions & 2 deletions apps/desktop/src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tonkeeper/extension",
"version": "3.13.0",
"version": "3.14.0",
"author": "Ton APPS UK Limited <[email protected]>",
"description": "Your extension wallet on The Open Network",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tonkeeper/web",
"version": "3.13.0",
"version": "3.14.0",
"author": "Ton APPS UK Limited <[email protected]>",
"description": "Your web wallet on The Open Network",
"dependencies": {
Expand Down

0 comments on commit 7a3d456

Please sign in to comment.