show confirm dialog before switching to desktop version

This commit is contained in:
MaysWind
2024-12-21 22:23:06 +08:00
parent fffe2a1ccb
commit 90b608bdc6
4 changed files with 9 additions and 4 deletions
+6 -4
View File
@@ -63,7 +63,7 @@
<f7-toggle :checked="isEnableAnimate" @toggle:change="isEnableAnimate = $event"></f7-toggle>
</f7-list-item>
<f7-list-item external :title="$t('Switch to Desktop Version')" :link="desktopVersionPath"></f7-list-item>
<f7-list-item :title="$t('Switch to Desktop Version')" @click="switchToDesktopVersion"></f7-list-item>
<f7-list-item :title="$t('About')" link="/about" :after="version"></f7-list-item>
</f7-list>
@@ -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());
});
}
}
};