1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

add closeChallenge method

This commit is contained in:
Andrew Simachev 2025-01-17 10:08:20 +01:00
parent ea95c0d875
commit 4e37e3f32f
No known key found for this signature in database
GPG key ID: 1DFE44B21443F0EF

View file

@ -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) {