断网后再次打开升级弹窗

This commit is contained in:
yj 2025-02-12 16:48:31 +08:00
parent e0ac4b2223
commit 7f9e62027a
4 changed files with 15 additions and 0 deletions

View File

@ -160,6 +160,10 @@ app.on('ready', () => {
startNumber++ startNumber++
} }
}); });
// 更新
ipcMain.handle('updateHandle', () => {
updateHandle()
});
// socket // socket
ipcMain.handle('startSignalr', (event, user) => { ipcMain.handle('startSignalr', (event, user) => {
startSignalr(user) startSignalr(user)

View File

@ -91,6 +91,10 @@ window.electron = {
setEnv: (str) => { setEnv: (str) => {
ipcRenderer.invoke('setEnv', str) ipcRenderer.invoke('setEnv', str)
}, },
// 更新
updateHandle: () => {
ipcRenderer.invoke('updateHandle')
},
// 通知下载最新的包 // 通知下载最新的包
onDownload: (type) => { onDownload: (type) => {
ipcRenderer.invoke('updateDownload', type) ipcRenderer.invoke('updateDownload', type)

View File

@ -260,6 +260,12 @@ const App: React.FC = () => {
storage.removeItem('user') storage.removeItem('user')
navigate('/login') navigate('/login')
} }
} else if (e.key === 'reconnect') {
if (e.value == true) {
if (location.hash.indexOf('/meeting') === -1) {
window.electron.updateHandle()
}
}
} }
}; };
return ( return (

1
src/render.d.ts vendored
View File

@ -25,6 +25,7 @@ export interface IElectronAPI {
quitAndInstall: (callBack: Function) => void; quitAndInstall: (callBack: Function) => void;
isOpenWindows: (callBack: Function) => void; isOpenWindows: (callBack: Function) => void;
setEnv: (str: string) => any; setEnv: (str: string) => any;
updateHandle: () => any;
getVersion: () => Promise<string>; getVersion: () => Promise<string>;
isVisible: () => Promise<string>; isVisible: () => Promise<string>;
setRegistry: (uuid: string) => any; setRegistry: (uuid: string) => any;