diff --git a/src/hooks/useComputeBacklinks.hook.ts b/src/hooks/useComputeBacklinks.hook.ts index bb4c5a8..8ed324a 100644 --- a/src/hooks/useComputeBacklinks.hook.ts +++ b/src/hooks/useComputeBacklinks.hook.ts @@ -29,6 +29,7 @@ export const useComputeBacklinks = () => { if (!isMarkdown(file.path) || !file.sha) { continue } + const fileBacklinkId = data.generateId(DataType.BacklinkNote, file.sha) const fileBacklink = await data.get( fileBacklinkId @@ -36,7 +37,11 @@ export const useComputeBacklinks = () => { if (fileBacklink) { continue } - backlinks.set(file.sha, []) + + if (!backlinks.has(file.sha)) { + backlinks.set(file.sha, []) + } + const { getContent } = useFile(file.sha, false) const note = await getContent() @@ -64,6 +69,7 @@ export const useComputeBacklinks = () => { } const previousBacklinks = backlinks.get(backlinkFile.sha) ?? [] + if (previousBacklinks.find((bl) => bl.sha === file.sha)) { continue } diff --git a/src/modules/card/components/FlipCard.vue b/src/modules/card/components/FlipCard.vue new file mode 100644 index 0000000..1c43d7a --- /dev/null +++ b/src/modules/card/components/FlipCard.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/modules/card/hooks/useSpacedRepetitionCards.ts b/src/modules/card/hooks/useSpacedRepetitionCards.ts index ed70fda..0775b65 100644 --- a/src/modules/card/hooks/useSpacedRepetitionCards.ts +++ b/src/modules/card/hooks/useSpacedRepetitionCards.ts @@ -19,10 +19,12 @@ export const useSpacedRepetitionCards = () => { const cards = asyncComputed(async () => { const cards: Card[] = [] + for (const cardFile of cardFiles.value) { if (!cardFile.sha) { continue } + const { getRawContent } = useFile(cardFile.sha, false) const content = await getRawContent() @@ -35,6 +37,7 @@ export const useSpacedRepetitionCards = () => { references: renderString(references) }) } + return cards }, []) diff --git a/src/views/SpacedRepetitionCard.vue b/src/views/SpacedRepetitionCard.vue index ca806ce..c022944 100644 --- a/src/views/SpacedRepetitionCard.vue +++ b/src/views/SpacedRepetitionCard.vue @@ -6,38 +6,23 @@ :repo="repo" :with-content="false" > -
-
-
-
-
-
-
-
-
-
+ +
No cards to review!