From b4c73e7ca157c025949540f6603fd27a016d3285 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 27 Jan 2023 11:52:31 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/7173 --- app/src/card/makeCard.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/card/makeCard.ts b/app/src/card/makeCard.ts index 805e547cb..d652732d3 100644 --- a/app/src/card/makeCard.ts +++ b/app/src/card/makeCard.ts @@ -234,6 +234,9 @@ const viewCards = (deckID: string, title: string, sourceElement: HTMLElement) => while (target && !dialog.element.isSameNode(target)) { const type = target.getAttribute("data-type"); if (type === "previous") { + if (pageIndex <= 1) { + return; + } pageIndex--; if (pageIndex <= 1) { previousElement.setAttribute("disabled", "disabled"); @@ -252,6 +255,9 @@ const viewCards = (deckID: string, title: string, sourceElement: HTMLElement) => event.preventDefault(); break; } else if (type === "next") { + if (pageIndex >= response.data.pageCount) { + return; + } pageIndex++; previousElement.removeAttribute("disabled"); fetchPost("/api/riff/getRiffCards", {deckID, page: pageIndex}, (cardsResponse) => {