Fix plans page hash does not get updated if no hash is on the URL

Example case: visit plans page via other pages, the hash will be empty initially, this commit will make sure hash is updated even though no initial hash exists.

GitOrigin-RevId: 411585111e8cf1b3eb803059ad4cf98ae4e69b19
This commit is contained in:
M Fahru 2024-05-28 20:22:44 -07:00 committed by Copybot
parent 218a4538c1
commit 69871fccbe

View file

@ -24,7 +24,7 @@ export function getViewInfoFromHash() {
*/
export function setHashFromViewTab(viewTab, period) {
const newHash = viewTab === 'group' ? 'group' : `${viewTab}-${period}`
if (window.location.hash.substring(1)) {
if (window.location.hash.substring(1) !== newHash) {
window.location.hash = newHash
}
}