From 30f200df30e2d272e06f887054cbfd4fea8b1999 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Wed, 6 May 2026 09:54:25 +0200 Subject: [PATCH] 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. --- src/components/FluxNote.vue | 11 +++++++++-- src/modules/repo/store/userRepo.store.ts | 6 ++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/FluxNote.vue b/src/components/FluxNote.vue index 1105269..dc4a687 100644 --- a/src/components/FluxNote.vue +++ b/src/components/FluxNote.vue @@ -5,6 +5,7 @@ import HeaderNote from "@/components/HeaderNote.vue" import SignInGithub from "@/components/SignInGithub.vue" import SkeletonLoader from "@/components/SkeletonLoader.vue" import StackedNote from "@/components/StackedNote.vue" +import { useGitHubLogin } from "@/hooks/useGitHubLogin.hook" import { useLinks } from "@/hooks/useLinks.hook" import { markdownBuilder } from "@/hooks/useMarkdown.hook" import { useNoteView } from "@/hooks/useNoteView.hook" @@ -44,6 +45,7 @@ const { listenToClick } = useLinks("note-display") const { stackedNotes, scrollToFocusedNote } = useRouteQueryStackedNotes() const { titles } = useNoteView() +const { isLogged } = useGitHubLogin() useResizeContainer("note-container", stackedNotes) const renderedContent = computed(() => @@ -104,8 +106,13 @@ onUnmounted(() => {
-

This repository is not accessible.

- + +

{ 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) {