From 45c03c2b40c39e6f118c111d66b3b279564acd57 Mon Sep 17 00:00:00 2001
From: NihadBadalov <32594553+NihadBadalov@users.noreply.github.com>
Date: Wed, 14 Feb 2024 10:31:31 +0100
Subject: [PATCH 1/7] Feat: Add optional width parameter to isMobile() method
---
src/mixins/mobile.js | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/mixins/mobile.js b/src/mixins/mobile.js
index c44edcff3..1f84c1bfc 100644
--- a/src/mixins/mobile.js
+++ b/src/mixins/mobile.js
@@ -36,8 +36,14 @@ export default {
},
computed: {
- isMobile() {
- return this.windowWidth <= 767.98;
+ /**
+ * @param {number? | undefined} width Width of the device
+ * @returns {boolean} Whether the device is mobile
+ */
+ isMobile(width) {
+ return (width && typeof width === "number"
+ ? width ?? this.windowWidth
+ : this.windowWidth) <= 767.98;
},
},
From aae0673a3dc30319fb14351cfb48c29d8df72b03 Mon Sep 17 00:00:00 2001
From: NihadBadalov <32594553+NihadBadalov@users.noreply.github.com>
Date: Wed, 14 Feb 2024 10:34:06 +0100
Subject: [PATCH 2/7] Feat: Redirect /link to /dashboard for non-mobile users
---
src/pages/List.vue | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/pages/List.vue b/src/pages/List.vue
index dd2d46059..58b23f13b 100644
--- a/src/pages/List.vue
+++ b/src/pages/List.vue
@@ -6,12 +6,18 @@