mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
9e9b43392e
commit
90fd8f7850
1 changed files with 10 additions and 9 deletions
|
|
@ -13,15 +13,6 @@ import {escapeHtml} from "../util/escape";
|
||||||
import {getDisplayName, movePathTo} from "../util/pathName";
|
import {getDisplayName, movePathTo} from "../util/pathName";
|
||||||
|
|
||||||
export const openCard = () => {
|
export const openCard = () => {
|
||||||
const exit = window.siyuan.dialogs.find(item => {
|
|
||||||
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.riffCard.custom) {
|
|
||||||
item.destroy();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (exit) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fetchPost("/api/riff/getRiffDueCards", {deckID: ""}, (cardsResponse) => {
|
fetchPost("/api/riff/getRiffDueCards", {deckID: ""}, (cardsResponse) => {
|
||||||
openCardByData(cardsResponse.data, "all");
|
openCardByData(cardsResponse.data, "all");
|
||||||
});
|
});
|
||||||
|
|
@ -31,6 +22,16 @@ export const openCardByData = (cardsData: {
|
||||||
cards: ICard[],
|
cards: ICard[],
|
||||||
unreviewedCount: number
|
unreviewedCount: number
|
||||||
}, cardType: "doc" | "notebook" | "all", id?: string, title?: string) => {
|
}, cardType: "doc" | "notebook" | "all", id?: string, title?: string) => {
|
||||||
|
const exit = window.siyuan.dialogs.find(item => {
|
||||||
|
if (item.element.getAttribute("data-key") === window.siyuan.config.keymap.general.riffCard.custom) {
|
||||||
|
item.destroy();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (exit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let blocks = cardsData.cards;
|
let blocks = cardsData.cards;
|
||||||
let index = 0;
|
let index = 0;
|
||||||
const dialog = new Dialog({
|
const dialog = new Dialog({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue