mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
refresh electron windows on power resume
This commit is contained in:
parent
87b12690bc
commit
fed6afa794
1 changed files with 6 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
const electron = require('electron');
|
||||
const { app, BrowserWindow, session, nativeTheme, ipcMain } = require('electron');
|
||||
const { app, BrowserWindow, session, nativeTheme, ipcMain, powerMonitor, dialog } = require('electron');
|
||||
const { is, fixPathForAsarUnpack } = require('electron-util');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
|
@ -33,6 +32,10 @@ if (process.defaultApp) {
|
|||
app.setAsDefaultProtocolClient(protocol);
|
||||
};
|
||||
|
||||
powerMonitor.on('resume', () => {
|
||||
BrowserWindow.getAllWindows().forEach(win => win.webContents.reload());
|
||||
});
|
||||
|
||||
let deeplinkingUrl = '';
|
||||
let waitLibraryPromise = null;
|
||||
let mainWindow = null;
|
||||
|
@ -77,7 +80,7 @@ function waitForLibraryAndCreateWindows () {
|
|||
global.serverAddress = Server.getAddress();
|
||||
createWindow();
|
||||
}, (err) => {
|
||||
electron.dialog.showErrorBox('Error: failed to run server', err.toString());
|
||||
dialog.showErrorBox('Error: failed to run server', err.toString());
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue