mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 14:07:01 +09:00
add closeChallenge method
This commit is contained in:
parent
ea95c0d875
commit
4e37e3f32f
1 changed files with 10 additions and 8 deletions
|
@ -21,7 +21,6 @@ class WindowManager {
|
|||
list = new Set();
|
||||
|
||||
create (options, param) {
|
||||
const { route, isChild } = options;
|
||||
const { hideMenuBar } = ConfigManager.config;
|
||||
|
||||
param = Object.assign({
|
||||
|
@ -45,8 +44,7 @@ class WindowManager {
|
|||
|
||||
remote.enable(win.webContents);
|
||||
|
||||
win.isChild = isChild;
|
||||
win.route = route;
|
||||
win = Object.assign(win, options);
|
||||
win.windowId = win.id;
|
||||
|
||||
this.list.add(win);
|
||||
|
@ -146,7 +144,7 @@ class WindowManager {
|
|||
const primaryDisplay = screen.getPrimaryDisplay();
|
||||
const { width, height } = primaryDisplay.workAreaSize;
|
||||
|
||||
const win = this.create({}, {
|
||||
const win = this.create({ isChallenge: true }, {
|
||||
backgroundColor: '',
|
||||
width: 424,
|
||||
height: 232,
|
||||
|
@ -165,12 +163,16 @@ class WindowManager {
|
|||
win.webContents.postMessage('challenge', options);
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
if (win && !win.isDestroyed()) {
|
||||
setTimeout(() => this.closeChallenge(), 30000);
|
||||
return win;
|
||||
};
|
||||
|
||||
closeChallenge () {
|
||||
for (const win of this.list) {
|
||||
if (win && win.isChallenge && !win.isDestroyed()) {
|
||||
win.close();
|
||||
};
|
||||
}, 30000);
|
||||
return win;
|
||||
};
|
||||
};
|
||||
|
||||
command (win, cmd, param) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue