diff --git a/backend/.gitignore b/backend/.gitignore index 30a3427..ac6bb9d 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1,3 +1,3 @@ /.env -/.venv/ +/venv/ *.pyc diff --git a/front-end/views/hashtag.mjs b/front-end/views/hashtag.mjs index 7b7e996..7961d36 100644 --- a/front-end/views/hashtag.mjs +++ b/front-end/views/hashtag.mjs @@ -17,7 +17,13 @@ import {createHeading} from "../components/heading.mjs"; function hashtagView(hashtag) { destroy(); - apiService.getBloomsByHashtag(hashtag); + //Only fetch if we are actually switching to a NEW hashtag or haven't loaded it yet + if (state.currentHashtag !== hashtag) { + // Tell the state what hashtag we are trying to load so it doesn't get stuck + state.updateState({ currentHashtag: hashtag }); + apiService.getBloomsByHashtag(hashtag); + return; // Stop this cycle; the state-change listener will re-trigger this view cleanly with data! + } renderOne( state.isLoggedIn,