store has a first copy of readme from cache is no waiting

This commit is contained in:
Julien Calixte
2023-08-13 21:07:17 +02:00
parent a741c7e1eb
commit 656e4b14a9
4 changed files with 33 additions and 17 deletions

View File

@@ -1,8 +1,8 @@
import { ref } from 'vue'
import { useMarkdown } from '@/hooks/useMarkdown.hook'
import { useNoteCache } from '@/modules/note/hooks/useNoteCache'
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
import { getFileContent } from '@/modules/repo/services/repo'
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
import { ref } from 'vue'
export const useFile = (sha: string, retrieveContent = true) => {
const { render } = useMarkdown(sha)
@@ -47,6 +47,7 @@ export const useFile = (sha: string, retrieveContent = true) => {
if (!contentFile) {
return null
}
saveCacheNote(contentFile)
return contentFile
}