Feat: Move redirect logic to `onResize`

pull/4492/head
NihadBadalov 10 months ago
parent 2aebf316a4
commit cfd20f086c

@ -19,6 +19,16 @@ export default {
onResize() {
this.windowWidth = window.innerWidth;
this.updateBody();
if (this.$router.currentRoute.value.path === "/dashboard"
|| this.$router.currentRoute.value.path === "/list") {
this.$router.push({
path: this.isMobile
? "/list"
: "/dashboard",
query: this.$router.currentRoute.value?.query,
});
}
},
/**

@ -11,11 +11,6 @@ export default {
components: {
MonitorList,
},
async mounted() {
if (!this.$root.isMobile) {
this.$router.push("/dashboard");
}
},
};
</script>

Loading…
Cancel
Save