🐛 desktop auth

This commit is contained in:
Vanessa 2023-11-10 11:07:15 +08:00
parent 62e27ba24c
commit e842a29e8b

View file

@ -418,7 +418,6 @@
<div class="b3-snackbar__content"></div>
</div>
<script>
const {ipcRenderer} = require('electron')
const exitApp = () => {
try {
const {ipcRenderer} = require('electron')
@ -514,9 +513,19 @@
}
try {
const {ipcRenderer} = require('electron')
ipcRenderer.on('siyuan-save-close', (event, close) => {
exitSiYuan()
})
await ipcRenderer.invoke("siyuan-init", {
languages: {{.trayMenuLangs}},
workspaceDir: '{{.workspaceDir}}',
port: location.port
});
ipcRenderer.send("siyuan-hotkey", {
languages: {{.trayMenuLangs}},
hotkeys: ['{{.keymapGeneralToggleWin}}']
});
} catch (e) {
// console.log(e)
}
@ -536,18 +545,7 @@
// 用于授权页保持连接,避免非常驻内存内核自动退出 https://github.com/siyuan-note/insider/issues/1099
new WebSocket((window.location.protocol === 'https:' ? 'wss' : 'ws') + '://' + window.location.host + '/ws?app=siyuan&id=auth')
await ipcRenderer.invoke("siyuan-init", {
languages: {{.trayMenuLangs}},
workspaceDir: '{{.workspaceDir}}',
port: location.port
});
ipcRenderer.send("siyuan-hotkey", {
languages: {{.trayMenuLangs}},
hotkeys: ['{{.keymapGeneralToggleWin}}']
});
}
init();
</script>
</body>