add a method to cache all files when necessary

This commit is contained in:
Julien Calixte
2024-09-01 00:25:11 +02:00
parent b4a7571b8a
commit df25634b98
3 changed files with 43 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import { computed, Ref, ref, toValue } from 'vue'
import { useMarkdown } from '@/hooks/useMarkdown.hook'
import { prepareNoteCache } from '@/modules/note/cache/prepareNoteCache'
import { getFileContent } from '@/modules/repo/services/repo'
import { queryFileContent } from '@/modules/repo/services/repo'
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
export const useFile = (sha: Ref<string> | string, retrieveContent = true) => {
@@ -48,7 +48,7 @@ export const useFile = (sha: Ref<string> | string, retrieveContent = true) => {
return cachedNote.content
}
const contentFile = await getFileContent(
const contentFile = await queryFileContent(
store.user,
store.repo,
toValue(sha)