| ... | @@ -223,12 +223,11 @@ export function viewAs(groups: string[] | null) { | ... | @@ -223,12 +223,11 @@ export function viewAs(groups: string[] | null) { |
| 223 | location.reload(); | 223 | location.reload(); |
| 224 | } | 224 | } |
| 225 | | 225 | |
| 226 | /** The signed-in user's corner. */ | | |
| 227 | function Whoami(props: { me: Me }) { | 226 | function Whoami(props: { me: Me }) { |
| 228 | const user = lastGood(account); | 227 | const user = lastGood(account); |
| 229 | const name = () => { | 228 | const name = () => { |
| 230 | const known = user(); | 229 | const known = user(); |
| 231 | return known ? displayName(known) : props.me.name; | 230 | return known ? displayName(known) : account.error ? props.me.name : ""; |
| 232 | }; | 231 | }; |
| 233 | const here = useMatch(() => "/account"); | 232 | const here = useMatch(() => "/account"); |
| 234 | const [picked, setPicked] = createSignal(props.me.viewing ? props.me.groups : []); | 233 | const [picked, setPicked] = createSignal(props.me.viewing ? props.me.groups : []); |
| ... | @@ -237,7 +236,7 @@ function Whoami(props: { me: Me }) { | ... | @@ -237,7 +236,7 @@ function Whoami(props: { me: Me }) { |
| 237 | <div class="whoami"> | 236 | <div class="whoami"> |
| 238 | <button class="whoami-button" classList={{ active: !!here() }} popovertarget="account-menu"> | 237 | <button class="whoami-button" classList={{ active: !!here() }} popovertarget="account-menu"> |
| 239 | <Avatar picture={user()?.picture ?? null} name={name()} /> | 238 | <Avatar picture={user()?.picture ?? null} name={name()} /> |
| 240 | <span class="name"><Show when={user()} fallback={account.error ? props.me.name : <span class="skeleton" style={{ width: "100px" }} />}> | 239 | <span class="name"><Show when={user()} fallback={account.error ? name() : <span class="skeleton" style={{ width: "100px" }} />}> |
| 241 | {(profile) => displayName(profile())} | 240 | {(profile) => displayName(profile())} |
| 242 | </Show></span> | 241 | </Show></span> |
| 243 | <ChevronsUpDown size={14} class="icon" /> | 242 | <ChevronsUpDown size={14} class="icon" /> |