From f68fab11eb7e6f60a72ddbce9cdd833c5cf326f9 Mon Sep 17 00:00:00 2001 From: miggymofongo Date: Thu, 5 Dec 2024 22:43:39 -0400 Subject: [PATCH] the profile view was not resetting to guest view after signing out because i forgot to add the event lister to the connected callback. now when you sign out, the profile view resets to guest view. --- src/pages/app-home.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/app-home.ts b/src/pages/app-home.ts index f083629..9105be3 100644 --- a/src/pages/app-home.ts +++ b/src/pages/app-home.ts @@ -109,7 +109,7 @@ Profile Picture Container `]; async firstUpdated() { - // this method is a lifecycle even in lit + // this method is a lifecycle event in lit // for more info check out the lit docs https://lit.dev/docs/components/lifecycle/ console.log('This is your home page'); } @@ -118,9 +118,10 @@ Profile Picture Container connectedCallback(): void { super.connectedCallback(); window.addEventListener('profile-updated', this.updateProfileFromEvent.bind(this)); + this.addEventListener('user-signed-out', this.handlesSignOut); const storedPubkey = localStorage.getItem('pubkey'); if (storedPubkey) { - // Manually fetch profile metadata on mount + // manually fetch profile metadata on mount this.nostrAddy = 'loading...'; this.bio = 'loading profile...'; this.profilePic = '/assets/img/default_pfp.png';