Преглед изворни кода

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
M Fahru пре 2 година
родитељ
комит
69871fccbe

+ 1 - 1
services/web/frontend/js/pages/user/subscription/plans-v2/plans-v2-hash.js

@@ -24,7 +24,7 @@ export function getViewInfoFromHash() {
  */
  */
 export function setHashFromViewTab(viewTab, period) {
 export function setHashFromViewTab(viewTab, period) {
   const newHash = viewTab === 'group' ? 'group' : `${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
     window.location.hash = newHash
   }
   }
 }
 }