修复潜在的bug

pull/225/head
lyswhut 2020-04-27 21:22:29 +08:00
parent 031c0c263d
commit ad8b338bd9
1 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,10 @@ const closeView = async() => {
mainHandle('xm_verify_open', (event, url) => new Promise((resolve, reject) => {
if (!global.mainWindow) return reject(new Error('mainwindow is undefined'))
if (view) view.destroy()
if (view) {
global.mainWindow.removeBrowserView(view)
view.destroy()
}
view = new BrowserView()
view.webContents.on('did-finish-load', () => {