fix(flux-note): stop showing sign-in prompt while readme is loading
Cache miss wrote null into store.readme before getMainReadme finished, collapsing isLoading and surfacing the not-accessible UI mid-fetch. Also branch that UI on auth state so signed-in users aren't told to sign in when access fails.
This commit is contained in:
@@ -166,8 +166,10 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
|
||||
|
||||
getCachedMainReadme(user, repo).then(async (cachedReadme) => {
|
||||
if (requestId !== this._requestId) return
|
||||
this.readme = cachedReadme
|
||||
this.readme = await getMainReadme(user, repo)
|
||||
if (cachedReadme) this.readme = cachedReadme
|
||||
const fetched = await getMainReadme(user, repo)
|
||||
if (requestId !== this._requestId) return
|
||||
this.readme = fetched
|
||||
})
|
||||
},
|
||||
addFile(file: RepoFile) {
|
||||
|
||||
Reference in New Issue
Block a user