From d7fcf3cbe1a5f04ba35a30425c237ff9bf1e93ec Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 9 May 2023 09:57:48 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/8202 --- app/src/types/index.d.ts | 3 +++ app/src/util/pathName.ts | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index f5eb3d516..2f036f003 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -183,6 +183,9 @@ interface INotebook { closed: boolean icon: string sort: number + dueFlashcardCount?: string; + newFlashcardCount?: string; + flashcardCount?: string; sortMode: number } diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index 53be41999..1513b15bd 100644 --- a/app/src/util/pathName.ts +++ b/app/src/util/pathName.ts @@ -175,6 +175,12 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void, let html = ""; notebooks.forEach((item) => { if (!item.closed) { + let countHTML = ""; + if (flashcard) { + countHTML = `${item.newFlashcardCount} +${item.dueFlashcardCount} +${item.flashcardCount}`; + } html += ``; } }); @@ -218,9 +225,9 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void, }) => { let countHTML = ""; if (flashcard) { - countHTML = `${item.newFlashcardCount} -${item.dueFlashcardCount} -${item.flashcardCount}`; + countHTML = `${item.newFlashcardCount} +${item.dueFlashcardCount} +${item.flashcardCount}`; } fileHTML += `
  • ${unicode2Emoji(item.boxIcon || Constants.SIYUAN_IMAGE_NOTE, false, "b3-list-item__graphic", true)} @@ -482,11 +489,11 @@ const getLeaf = (liElement: HTMLElement, flashcard: boolean) => { response.data.files.forEach((item: IFile) => { let countHTML = ""; if (flashcard) { - countHTML = `${item.newFlashcardCount} -${item.dueFlashcardCount} -${item.flashcardCount}`; + countHTML = `${item.newFlashcardCount} +${item.dueFlashcardCount} +${item.flashcardCount}`; } else if (item.count && item.count > 0) { - countHTML = `${item.count}`; + countHTML = `${item.count}`; } fileHTML += `