From 402ecfb4f9cede0e0cfeaf6459b556045cb25ecc Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 22 Oct 2022 17:48:46 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E9=99=90=E5=88=B6=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=89=93=E5=BC=80=E6=95=B0=E9=87=8F=E4=B8=BA?= =?UTF-8?q?=20`32`=20Fix=20https://github.com/siyuan-note/siyuan/issues/63?= =?UTF-8?q?03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/config/fileTree.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/config/fileTree.ts b/app/src/config/fileTree.ts index c49ec594c..aff5c894a 100644 --- a/app/src/config/fileTree.ts +++ b/app/src/config/fileTree.ts @@ -77,6 +77,16 @@ export const fileTree = { `; }, _send() { + let inputMaxOpenTabCount = parseInt((fileTree.element.querySelector("#maxOpenTabCount") as HTMLInputElement).value); + if (32 < inputMaxOpenTabCount) { + inputMaxOpenTabCount = 32; + (fileTree.element.querySelector("#maxOpenTabCount") as HTMLInputElement).value = "32"; + } + if (1 > inputMaxOpenTabCount) { + inputMaxOpenTabCount = 1; + (fileTree.element.querySelector("#maxOpenTabCount") as HTMLInputElement).value = "1"; + } + fetchPost("/api/setting/setFiletree", { sort: window.siyuan.config.fileTree.sort, alwaysSelectOpenedFile: (fileTree.element.querySelector("#alwaysSelectOpenedFile") as HTMLInputElement).checked, @@ -87,7 +97,7 @@ export const fileTree = { allowCreateDeeper: (fileTree.element.querySelector("#allowCreateDeeper") as HTMLInputElement).checked, removeDocWithoutConfirm: (fileTree.element.querySelector("#removeDocWithoutConfirm") as HTMLInputElement).checked, maxListCount: parseInt((fileTree.element.querySelector("#maxListCount") as HTMLInputElement).value), - maxOpenTabCount: parseInt((fileTree.element.querySelector("#maxOpenTabCount") as HTMLInputElement).value), + maxOpenTabCount: inputMaxOpenTabCount, }, response => { fileTree.onSetfiletree(response.data); });