⚡️ (user settings) eager api call
This commit is contained in:
@@ -42,21 +42,27 @@ export const useUserRepoStore = defineStore({
|
|||||||
console.warn('impossible to refresh token')
|
console.warn('impossible to refresh token')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.readme = await getCachedMainReadme(newUser, newRepo)
|
getFiles(newUser, newRepo)
|
||||||
|
.then((files) => {
|
||||||
|
this.files = files
|
||||||
|
return getUserSettingsContent(newUser, newRepo, files)
|
||||||
|
})
|
||||||
|
.then((userSettings) => (this.userSettings = userSettings))
|
||||||
|
|
||||||
getMainReadme(newUser, newRepo).then((readme) => {
|
getCachedMainReadme(newUser, newRepo)
|
||||||
this.readme = readme
|
.then((readme) => {
|
||||||
|
this.readme = readme
|
||||||
|
})
|
||||||
|
.then(() => getMainReadme(newUser, newRepo))
|
||||||
|
.then((readme) => {
|
||||||
|
this.readme = readme
|
||||||
|
|
||||||
// if the offline state is too quick,
|
// if the offline state is too quick,
|
||||||
// it gives more the impression of glitch.
|
// it gives an impression of glitch.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.isReadmeOffline = false
|
this.isReadmeOffline = false
|
||||||
}, 500)
|
}, 500)
|
||||||
})
|
})
|
||||||
|
|
||||||
const files = await getFiles(newUser, newRepo)
|
|
||||||
this.files = files
|
|
||||||
this.userSettings = await getUserSettingsContent(newUser, newRepo, files)
|
|
||||||
},
|
},
|
||||||
resetUserRepo() {
|
resetUserRepo() {
|
||||||
this.user = ''
|
this.user = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user