diff --git a/app/assets/v2/js/pages/dashboard-hackathon.js b/app/assets/v2/js/pages/dashboard-hackathon.js index b4e55fdc430..87de8c8a536 100644 --- a/app/assets/v2/js/pages/dashboard-hackathon.js +++ b/app/assets/v2/js/pages/dashboard-hackathon.js @@ -877,6 +877,12 @@ refreshBounties(null, 0, false); initDOM(); addPopover(); + $(window).on('popstate', function(e) { + e.preventDefault(); + // we change the url with the panels to ensure if you refresh or get linked here you're being shown what you want + // this is so that we go back to where we got sent here from, townsquare, etc. + window.location = document.referrer; + }); }, 0); }, methods: { @@ -908,12 +914,6 @@ history.pushState({}, `${vm.hackathonObj['slug']} - ${newPathName}`, newUrl); - $(window).on('popstate', function(e) { - e.preventDefault(); - // we change the url with the panels to ensure if you refresh or get linked here you're being shown what you want - // this is so that we go back to where we got sent here from, townsquare, etc. - window.location = document.referrer; - }); } }, data: () => ({ diff --git a/app/assets/v2/js/pages/profile-tribes.js b/app/assets/v2/js/pages/profile-tribes.js index 5c54f24b932..88505ce2548 100644 --- a/app/assets/v2/js/pages/profile-tribes.js +++ b/app/assets/v2/js/pages/profile-tribes.js @@ -226,7 +226,12 @@ const loadDynamicScript = (callback, url, id) => { } }, mounted() { - console.log('we mounted'); + $(window).on('popstate', function(e) { + e.preventDefault(); + // we change the url with the panels to ensure if you refresh or get linked here you're being shown what you want + // this is so that we go back to where we got sent here from, townsquare, etc. + window.location = document.referrer; + }); let vm = this; vm.isLoading = false;