[+] Dynamically initialize first state based on pathname

This commit is contained in:
Hykilpikonna
2019-10-14 18:01:43 -04:00
parent 1a8fc9eab4
commit 88b0ef752c
+3 -2
View File
@@ -19,8 +19,9 @@ export default class Navigation extends Vue
*/
public created()
{
// Set history state (TODO: Dynamically detect initial url
window.history.replaceState({lastTab: 'overall'}, '', '/overall');
// Set history state
let url = window.location.pathname;
window.history.replaceState({lastTab: url.substring(1)}, '', url);
// Create history state listener
window.onpopstate = e =>