trying to be as little blocking as possible

This commit is contained in:
Julien Calixte
2023-08-17 10:42:40 +02:00
parent df69d90632
commit bd9d97b0af
3 changed files with 15 additions and 15 deletions

View File

@@ -69,5 +69,6 @@
"patchedDependencies": {
"@vueuse/router@10.3.0": "patches/@vueuse__router@10.3.0.patch"
}
}
},
"packageManager": "pnpm@8.6.12"
}

View File

@@ -44,19 +44,18 @@ export const useUserRepoStore = defineStore({
this.readme = await getCachedMainReadme(newUser, newRepo)
const [readme, files] = await Promise.all([
getMainReadme(newUser, newRepo),
getFiles(newUser, newRepo)
])
this.readme = readme
getMainReadme(newUser, newRepo).then((readme) => {
this.readme = readme
// if the offline state is too quick,
// it gives more the impression of glitch.
setTimeout(() => {
this.isReadmeOffline = false
}, 500)
})
const files = await getFiles(newUser, newRepo)
this.files = files
// if the offline state is too quick,
// it gives more the impression of glitch.
setTimeout(() => {
this.isReadmeOffline = false
}, 500)
this.userSettings = await getUserSettingsContent(newUser, newRepo, files)
},
resetUserRepo() {

View File

@@ -33,9 +33,9 @@ export const needToRefreshToken = async () => {
}
const expirationDate = new Date(accessToken.expirationDate)
const dateToCompare = addMinutes(new Date(), 15)
const minimumViableDate = addMinutes(new Date(), 15)
return isBefore(expirationDate, dateToCompare)
return isBefore(expirationDate, minimumViableDate)
}
export const refreshToken = async () => {