Remove ugly try/catch logic in Navbar
@@ -73,20 +73,20 @@ export default {
},
methods: {
goToTokens() {
- // Throws an error when moving
- // to the same route
- try {
+ if (!this.isMainPage) {
+ return;
+ }
+
this.$router.push('/tokens');
this.isMainPage = false;
- } catch {}
},
goToHome() {
- // Throws an error when moving
- // to the same route
- try {
+ if (this.isMainPage) {
+ return;
+ }
+
this.$router.push('/');
this.isMainPage = true;
- } catch {}
}
},
async created() {
