mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 重建索引出现多个后台图标 Fix https://github.com/siyuan-note/siyuan/issues/7004
This commit is contained in:
parent
093b807971
commit
1adcf9ca6c
1 changed files with 15 additions and 4 deletions
|
|
@ -52,7 +52,9 @@ try {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
require('electron').dialog.showErrorBox('创建配置目录失败 Failed to create config directory',
|
require('electron').
|
||||||
|
dialog.
|
||||||
|
showErrorBox('创建配置目录失败 Failed to create config directory',
|
||||||
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
||||||
app.exit()
|
app.exit()
|
||||||
}
|
}
|
||||||
|
|
@ -721,6 +723,14 @@ app.whenReady().then(() => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
ipcMain.on('siyuan-init', async (event, data) => {
|
ipcMain.on('siyuan-init', async (event, data) => {
|
||||||
|
const exitWS = workspaces.find(item => {
|
||||||
|
if (data.id === item.id && item.workspaceDir) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (exitWS) {
|
||||||
|
return
|
||||||
|
}
|
||||||
let tray
|
let tray
|
||||||
if ('win32' === process.platform || 'linux' === process.platform) {
|
if ('win32' === process.platform || 'linux' === process.platform) {
|
||||||
// 系统托盘
|
// 系统托盘
|
||||||
|
|
@ -883,7 +893,7 @@ app.on('before-quit', (event) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const {powerMonitor} = require('electron')
|
const {powerMonitor} = require('electron')
|
||||||
const {write} = require("fs");
|
const {write} = require('fs')
|
||||||
|
|
||||||
powerMonitor.on('suspend', () => {
|
powerMonitor.on('suspend', () => {
|
||||||
writeLog('system suspend')
|
writeLog('system suspend')
|
||||||
|
|
@ -924,7 +934,8 @@ powerMonitor.on('resume', async () => {
|
||||||
workspaces.forEach(item => {
|
workspaces.forEach(item => {
|
||||||
const currentURL = new URL(item.browserWindow.getURL())
|
const currentURL = new URL(item.browserWindow.getURL())
|
||||||
const server = getServer(currentURL.port)
|
const server = getServer(currentURL.port)
|
||||||
writeLog('sync after system resume [' + server + '/api/sync/performSync' + ']')
|
writeLog(
|
||||||
|
'sync after system resume [' + server + '/api/sync/performSync' + ']')
|
||||||
fetch(server + '/api/sync/performSync', {method: 'POST'})
|
fetch(server + '/api/sync/performSync', {method: 'POST'})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue