bak
This commit is contained in:
@@ -23,6 +23,13 @@ export async function clearBrowserCache() {
|
||||
}
|
||||
|
||||
export function createTray() {
|
||||
// 防止重复创建托盘
|
||||
if (tray) {
|
||||
logger.info('托盘已存在,跳过创建')
|
||||
return
|
||||
}
|
||||
|
||||
logger.info('开始创建托盘图标')
|
||||
// 创建托盘图标
|
||||
tray = new Tray(icon)
|
||||
|
||||
@@ -165,7 +172,11 @@ export function createTray() {
|
||||
|
||||
export function destroyTray() {
|
||||
if (tray) {
|
||||
logger.info('销毁托盘图标')
|
||||
tray.destroy()
|
||||
tray = null
|
||||
logger.info('托盘图标已销毁')
|
||||
} else {
|
||||
logger.info('托盘图标不存在,无需销毁')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user