♻️ (flux note) move in a component flux …

flux note will be used for fleeting notes and
drafts too
This commit is contained in:
2021-03-20 19:40:00 +01:00
parent fc008bbaf8
commit a8cc196508
8 changed files with 181 additions and 96 deletions

View File

@@ -14,7 +14,11 @@ interface Tree {
url?: string
}
export const useRepo = (owner: Ref<string>, repo: Ref<string>) => {
export const useRepo = (
owner: Ref<string>,
repo: Ref<string>,
fetchRepo = true
) => {
const { getCachedNote, saveCacheNote } = useNoteCache('README')
const { accessToken } = useGitHubLogin()
@@ -83,7 +87,11 @@ export const useRepo = (owner: Ref<string>, repo: Ref<string>) => {
}
}
onMounted(() => retrieveRepo())
onMounted(() => {
if (fetchRepo) {
retrieveRepo()
}
})
watch([owner, repo], () => retrieveRepo())