fix(console): 停止服务时同步关闭扩展屏大屏窗口
This commit is contained in:
1 parent
e86ca24d0e
commit
f3813171d3
1 file changed
+16
@@ -341,6 +341,22 @@ function main() {
|
||||
service.on('status', (status) => {
|
||||
broadcastStatus()
|
||||
refreshTray()
|
||||
|
||||
// 服务停了,大屏已无数据可显示,同步关掉扩展屏窗口;
|
||||
// 放在状态回调里,IPC 按钮和托盘菜单两条停止路径都能覆盖。
|
||||
if (status.state === 'stopped') {
|
||||
if (displayFallbackTimer) {
|
||||
clearTimeout(displayFallbackTimer)
|
||||
displayFallbackTimer = null
|
||||
}
|
||||
if (displays && displaysEnabled) {
|
||||
displays.closeAll()
|
||||
log.push('console', '服务已停止,大屏窗口已关闭')
|
||||
}
|
||||
displaysEnabled = false
|
||||
return
|
||||
}
|
||||
|
||||
if (!status.healthy) return
|
||||
// 服务端恢复后必须让大屏重新加载,否则页面还停在断线兜底画面上
|
||||
if (displaysEnabled) displays.relayout()
|
||||
|
||||
Reference in new issue
Block a user