From eea13bfc659e8d721654b2399d9b5289aa521e2e Mon Sep 17 00:00:00 2001 From: Frank Noirot Date: Fri, 5 Jan 2024 13:12:41 -0500 Subject: [PATCH] Add optional chaining because name can be undefined (#91) * Add optional chaining because name can be undefined * fmt --- src/components/AccountMenu.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/AccountMenu.svelte b/src/components/AccountMenu.svelte index 773b332..9d0e727 100644 --- a/src/components/AccountMenu.svelte +++ b/src/components/AccountMenu.svelte @@ -38,8 +38,10 @@ {#if shouldDisplayInitial} {user.name[0] || user.first_name[0] || user.email[0]} + {user.name?.[0] || user.first_name?.[0] || user.email?.[0]} + {:else if !shouldDisplayImage}