♻️ (folder notes)

This commit is contained in:
Julien Calixte
2021-08-08 00:19:25 +02:00
parent 17178bbe63
commit a3082f25bd
2 changed files with 4 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ import { Card } from '@/modules/card/models/Card'
import { RepetitionCard } from '@/modules/card/models/RepetitionCard' import { RepetitionCard } from '@/modules/card/models/RepetitionCard'
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store' import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
import { asyncComputed } from '@vueuse/core' import { asyncComputed } from '@vueuse/core'
import { isAfter, isBefore } from 'date-fns' import { isAfter } from 'date-fns'
import { computed, nextTick, watch } from 'vue' import { computed, nextTick, watch } from 'vue'
interface Repetition { interface Repetition {

View File

@@ -4,7 +4,7 @@ import { computed } from 'vue'
export const useFolderNotes = (folders: string[]) => { export const useFolderNotes = (folders: string[]) => {
const store = useUserRepoStore() const store = useUserRepoStore()
const fleetingNotes = computed(() => const filteredNotes = computed(() =>
store.files.filter( store.files.filter(
(file) => (file) =>
folders.some((folder) => file.path?.startsWith(folder)) && folders.some((folder) => file.path?.startsWith(folder)) &&
@@ -13,8 +13,8 @@ export const useFolderNotes = (folders: string[]) => {
) )
const content = computed(() => const content = computed(() =>
fleetingNotes.value?.length > 0 filteredNotes.value?.length > 0
? fleetingNotes.value ? filteredNotes.value
.map((note) => { .map((note) => {
const firstFolder = note.path?.split('/').shift() const firstFolder = note.path?.split('/').shift()