diff --git a/.gitignore b/.gitignore index e43b0f98..a0f3a019 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,11 @@ .DS_Store +# Virtual environments +venv/ +.venv/ +env/ +.env/ +ENV/ + +# Python cache files +__pycache__/ +*.pyc diff --git a/front-end/views/hashtag.mjs b/front-end/views/hashtag.mjs index 7b7e9969..22740844 100644 --- a/front-end/views/hashtag.mjs +++ b/front-end/views/hashtag.mjs @@ -1,4 +1,4 @@ -import {renderOne, renderEach, destroy} from "../lib/render.mjs"; +import { renderOne, renderEach, destroy } from "../lib/render.mjs"; import { state, apiService, @@ -7,17 +7,19 @@ import { getTimelineContainer, getHeadingContainer, } from "../index.mjs"; -import {createLogin, handleLogin} from "../components/login.mjs"; -import {createLogout, handleLogout} from "../components/logout.mjs"; -import {createBloom} from "../components/bloom.mjs"; -import {createHeading} from "../components/heading.mjs"; +import { createLogin, handleLogin } from "../components/login.mjs"; +import { createLogout, handleLogout } from "../components/logout.mjs"; +import { createBloom } from "../components/bloom.mjs"; +import { createHeading } from "../components/heading.mjs"; // Hashtag view: show all tweets containing this tag function hashtagView(hashtag) { destroy(); - apiService.getBloomsByHashtag(hashtag); + if (hashtag !== state.currentHashtag) { + apiService.getBloomsByHashtag(hashtag); + } renderOne( state.isLoggedIn, @@ -52,4 +54,4 @@ function hashtagView(hashtag) { ); } -export {hashtagView}; +export { hashtagView };