trying to be as little blocking as possible
This commit is contained in:
@@ -44,19 +44,18 @@ export const useUserRepoStore = defineStore({
|
|||||||
|
|
||||||
this.readme = await getCachedMainReadme(newUser, newRepo)
|
this.readme = await getCachedMainReadme(newUser, newRepo)
|
||||||
|
|
||||||
const [readme, files] = await Promise.all([
|
getMainReadme(newUser, newRepo).then((readme) => {
|
||||||
getMainReadme(newUser, newRepo),
|
this.readme = readme
|
||||||
getFiles(newUser, newRepo)
|
|
||||||
])
|
// if the offline state is too quick,
|
||||||
this.readme = readme
|
// it gives more the impression of glitch.
|
||||||
|
setTimeout(() => {
|
||||||
|
this.isReadmeOffline = false
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
|
|
||||||
|
const files = await getFiles(newUser, newRepo)
|
||||||
this.files = files
|
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)
|
this.userSettings = await getUserSettingsContent(newUser, newRepo, files)
|
||||||
},
|
},
|
||||||
resetUserRepo() {
|
resetUserRepo() {
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ export const needToRefreshToken = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const expirationDate = new Date(accessToken.expirationDate)
|
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 () => {
|
export const refreshToken = async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user