From 90b608bdc6ceeec82d44b93149960d5bde535a26 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 21 Dec 2024 22:23:06 +0800 Subject: [PATCH] show confirm dialog before switching to desktop version --- src/locales/en.json | 1 + src/locales/vi.json | 1 + src/locales/zh_Hans.json | 1 + src/views/mobile/SettingsPage.vue | 10 ++++++---- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 717ee51a..2a13a3f5 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1905,6 +1905,7 @@ "You can scan the QR code below on your mobile device.": "You can scan the QR code below on your mobile device.", "Switch to Mobile Version": "Switch to Mobile Version", "Switch to Desktop Version": "Switch to Desktop Version", + "Are you sure you want to switch to desktop version?": "Are you sure you want to switch to desktop version?", "About": "About", "Build Time": "Build Time", "Official Website": "Official Website", diff --git a/src/locales/vi.json b/src/locales/vi.json index 8dbb0127..6321c963 100644 --- a/src/locales/vi.json +++ b/src/locales/vi.json @@ -1905,6 +1905,7 @@ "You can scan the QR code below on your mobile device.": "Bạn có thể quét mã QR bên dưới trên thiết bị di động của mình.", "Switch to Mobile Version": "Chuyển sang phiên bản di động", "Switch to Desktop Version": "Chuyển sang phiên bản máy tính để bàn", + "Are you sure you want to switch to desktop version?": "Are you sure you want to switch to desktop version?", "About": "Giới thiệu", "Build Time": "Thời gian xây dựng", "Official Website": "Trang web chính thức", diff --git a/src/locales/zh_Hans.json b/src/locales/zh_Hans.json index 95d137cd..9788ba2f 100644 --- a/src/locales/zh_Hans.json +++ b/src/locales/zh_Hans.json @@ -1905,6 +1905,7 @@ "You can scan the QR code below on your mobile device.": "您可以在您的移动设备上扫描下方二维码。", "Switch to Mobile Version": "切换到移动版", "Switch to Desktop Version": "切换到桌面版", + "Are you sure you want to switch to desktop version?": "您确定要切换到桌面版?", "About": "关于", "Build Time": "编译时间", "Official Website": "官方网站", diff --git a/src/views/mobile/SettingsPage.vue b/src/views/mobile/SettingsPage.vue index a2cda6f2..07f258ce 100644 --- a/src/views/mobile/SettingsPage.vue +++ b/src/views/mobile/SettingsPage.vue @@ -63,7 +63,7 @@ - + @@ -101,9 +101,6 @@ export default { version() { return 'v' + this.$version; }, - desktopVersionPath() { - return getDesktopVersionPath(); - }, allTimezones() { return this.$locale.getAllTimezones(true); }, @@ -204,6 +201,11 @@ export default { } }); }); + }, + switchToDesktopVersion() { + this.$confirm('Are you sure you want to switch to desktop version?', () => { + window.location.replace(getDesktopVersionPath()); + }); } } };