From 5143cc2b73f0d091647f8a9da1b176c07797c948 Mon Sep 17 00:00:00 2001 From: delmorallopez <124817272+delmorallopez@users.noreply.github.com> Date: Thu, 16 Apr 2026 18:31:38 +0100 Subject: [PATCH 1/2] fix error hashtag link --- front-end/views/hashtag.mjs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/front-end/views/hashtag.mjs b/front-end/views/hashtag.mjs index 7b7e996..a77a54b 100644 --- a/front-end/views/hashtag.mjs +++ b/front-end/views/hashtag.mjs @@ -14,10 +14,13 @@ import {createHeading} from "../components/heading.mjs"; // Hashtag view: show all tweets containing this tag -function hashtagView(hashtag) { +async function hashtagView(hashtag) { destroy(); - apiService.getBloomsByHashtag(hashtag); + // prevent infinite loop + if (state.currentHashtag !== `#${hashtag}`) { + await apiService.getBloomsByHashtag(hashtag); + } renderOne( state.isLoggedIn, @@ -28,6 +31,7 @@ function hashtagView(hashtag) { document .querySelector("[data-action='logout']") ?.addEventListener("click", handleLogout); + renderOne( state.isLoggedIn, getLoginContainer(), @@ -35,8 +39,8 @@ function hashtagView(hashtag) { createLogin ); document - .querySelector("[data-action='login']") - ?.addEventListener("click", handleLogin); + .querySelector('[data-form="login"]') + ?.addEventListener("submit", handleLogin); // also fix this 👀 renderOne( state.currentHashtag, @@ -44,6 +48,7 @@ function hashtagView(hashtag) { "heading-template", createHeading ); + renderEach( state.hashtagBlooms || [], getTimelineContainer(), From f207ccd2096777f7e7926daa4c359d037c5ac2df Mon Sep 17 00:00:00 2001 From: delmorallopez <124817272+delmorallopez@users.noreply.github.com> Date: Fri, 17 Apr 2026 10:31:29 +0100 Subject: [PATCH 2/2] fix page flashes blank --- front-end/index.mjs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/front-end/index.mjs b/front-end/index.mjs index be49922..1a1aff4 100644 --- a/front-end/index.mjs +++ b/front-end/index.mjs @@ -37,12 +37,7 @@ async function init() { await apiService.getProfile(profileUsername); } } - handleRouteChange(); - - document.addEventListener("state-change", () => { - handleRouteChange(); - }); } // TODO Check any unhandled errors bubble up to this central handler