mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-09 00:34:20 +01:00
🐛 Can't switch workspaces on mobile https://github.com/siyuan-note/siyuan/issues/16544
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
444b38aa26
commit
00d00b54ef
6 changed files with 24 additions and 23 deletions
|
|
@ -280,20 +280,20 @@ export const kernelError = () => {
|
|||
}
|
||||
};
|
||||
|
||||
export const exitSiYuan = async () => {
|
||||
export const exitSiYuan = async (setCurrentWorkspace = true) => {
|
||||
hideAllElements(["util"]);
|
||||
/// #if MOBILE
|
||||
if (window.siyuan.mobile.editor) {
|
||||
await saveScroll(window.siyuan.mobile.editor.protyle);
|
||||
}
|
||||
/// #endif
|
||||
fetchPost("/api/system/exit", {force: false}, (response) => {
|
||||
fetchPost("/api/system/exit", {force: false, setCurrentWorkspace}, (response) => {
|
||||
if (response.code === 1) { // 同步执行失败
|
||||
const msgId = showMessage(response.msg, response.data.closeTimeout, "error");
|
||||
const buttonElement = document.querySelector(`#message [data-id="${msgId}"] button`);
|
||||
if (buttonElement) {
|
||||
buttonElement.addEventListener("click", () => {
|
||||
fetchPost("/api/system/exit", {force: true}, () => {
|
||||
fetchPost("/api/system/exit", {force: true, setCurrentWorkspace}, () => {
|
||||
/// #if !BROWSER
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, location.port);
|
||||
/// #else
|
||||
|
|
@ -318,6 +318,7 @@ export const exitSiYuan = async () => {
|
|||
confirmDialog(window.siyuan.languages.tip, response.msg, () => {
|
||||
fetchPost("/api/system/exit", {
|
||||
force: true,
|
||||
setCurrentWorkspace,
|
||||
execInstallPkg: 2 // 0:默认检查新版本,1:不执行新版本安装,2:执行新版本安装
|
||||
}, () => {
|
||||
/// #if !BROWSER
|
||||
|
|
@ -335,6 +336,7 @@ export const exitSiYuan = async () => {
|
|||
}, () => {
|
||||
fetchPost("/api/system/exit", {
|
||||
force: true,
|
||||
setCurrentWorkspace,
|
||||
execInstallPkg: 1 // 0:默认检查新版本,1:不执行新版本安装,2:执行新版本安装
|
||||
}, () => {
|
||||
/// #if !BROWSER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue