From 181ddce88759495c9fb300e5b64d60b08a04b5b3 Mon Sep 17 00:00:00 2001 From: soulsands <407221377@qq.com> Date: Sat, 8 Apr 2023 20:49:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E3=80=80remove=20misleading=20await?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/app/services/branches.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/public/app/services/branches.js b/src/public/app/services/branches.js index b94c95b2a..c414cf257 100644 --- a/src/public/app/services/branches.js +++ b/src/public/app/services/branches.js @@ -10,7 +10,7 @@ async function moveBeforeBranch(branchIdsToMove, beforeBranchId) { branchIdsToMove = filterRootNote(branchIdsToMove); branchIdsToMove = filterSearchBranches(branchIdsToMove); - const beforeBranch = await froca.getBranch(beforeBranchId); + const beforeBranch = froca.getBranch(beforeBranchId); if (['root', '_lbRoot', '_lbAvailableLaunchers', '_lbVisibleLaunchers'].includes(beforeBranch.noteId)) { toastService.showError('Cannot move notes here.'); @@ -31,7 +31,7 @@ async function moveAfterBranch(branchIdsToMove, afterBranchId) { branchIdsToMove = filterRootNote(branchIdsToMove); branchIdsToMove = filterSearchBranches(branchIdsToMove); - const afterNote = await froca.getBranch(afterBranchId).getNote(); + const afterNote = froca.getBranch(afterBranchId).getNote(); const forbiddenNoteIds = [ 'root', @@ -59,7 +59,7 @@ async function moveAfterBranch(branchIdsToMove, afterBranchId) { } async function moveToParentNote(branchIdsToMove, newParentBranchId) { - const newParentBranch = await froca.getBranch(newParentBranchId); + const newParentBranch = froca.getBranch(newParentBranchId); if (newParentBranch.noteId === '_lbRoot') { toastService.showError('Cannot move notes here.'); @@ -165,7 +165,7 @@ function filterRootNote(branchIds) { const hoistedNoteId = hoistedNoteService.getHoistedNoteId(); return branchIds.filter(branchId => { - const branch = froca.getBranch(branchId); + const branch = froca.getBranch(branchId); return branch.noteId !== 'root' && branch.noteId !== hoistedNoteId;