mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
36f82cc030
commit
c084d97890
1 changed files with 5 additions and 5 deletions
|
|
@ -646,8 +646,8 @@ const initAbout = () => {
|
|||
} else if (target.id === "openWorkspace") {
|
||||
fetchPost("/api/system/getMobileWorkspaces", {}, (response) => {
|
||||
let selectHTML = ""
|
||||
response.data.forEach((item: string, index:number) => {
|
||||
selectHTML += `<option value="${item}" selected="selected">${item}</option>`
|
||||
response.data.forEach((item: string, index: number) => {
|
||||
selectHTML += `<option value="${item}"${index === 0 ? ' selected="selected"' : ""}>${pathPosix().basename(item)}</option>`
|
||||
})
|
||||
const openWorkspaceDialog = new Dialog({
|
||||
title: window.siyuan.languages.openBy,
|
||||
|
|
@ -665,10 +665,10 @@ const initAbout = () => {
|
|||
openWorkspaceDialog.destroy();
|
||||
});
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
const openName = openWorkspaceDialog.element.querySelector("select").value;
|
||||
confirmDialog(window.siyuan.languages.confirm, `${pathPosix().basename(window.siyuan.config.system.workspaceDir)} -> ${openName}?`, () => {
|
||||
const openPath = openWorkspaceDialog.element.querySelector("select").value;
|
||||
confirmDialog(window.siyuan.languages.confirm, `${pathPosix().basename(window.siyuan.config.system.workspaceDir)} -> ${pathPosix().basename(openPath)}?`, () => {
|
||||
fetchPost("/api/system/setWorkspaceDir", {
|
||||
path: target.getAttribute("data-path")
|
||||
path: openPath
|
||||
}, () => {
|
||||
exitSiYuan();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue