リロード確認ダイアログ表示

This commit is contained in:
syuilo 2020-12-28 17:18:13 +09:00
parent 948a65bf39
commit 1157298eb8

View file

@ -94,6 +94,7 @@ import MkLink from '@/components/link.vue';
import { langs } from '@/config'; import { langs } from '@/config';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';
import { ColdDeviceStorage } from '@/store'; import { ColdDeviceStorage } from '@/store';
import * as os from '@/os';
export default defineComponent({ export default defineComponent({
components: { components: {
@ -146,7 +147,7 @@ export default defineComponent({
lang() { lang() {
localStorage.setItem('lang', this.lang); localStorage.setItem('lang', this.lang);
localStorage.removeItem('locale'); localStorage.removeItem('locale');
location.reload(); this.reloadAsk();
}, },
fontSize() { fontSize() {
@ -155,7 +156,7 @@ export default defineComponent({
} else { } else {
localStorage.setItem('fontSize', this.fontSize); localStorage.setItem('fontSize', this.fontSize);
} }
location.reload(); this.reloadAsk();
}, },
useSystemFont() { useSystemFont() {
@ -164,16 +165,33 @@ export default defineComponent({
} else { } else {
localStorage.removeItem('useSystemFont'); localStorage.removeItem('useSystemFont');
} }
location.reload(); this.reloadAsk();
}, },
enableInfiniteScroll() { enableInfiniteScroll() {
location.reload() this.reloadAsk();
},
showGapBetweenNotesInTimeline() {
this.reloadAsk();
}, },
}, },
mounted() { mounted() {
this.$emit('info', this.INFO); this.$emit('info', this.INFO);
}, },
methods: {
async reloadAsk() {
const { canceled } = await os.dialog({
type: 'info',
text: this.$ts.reloadToApplySetting,
showCancelButton: true
});
if (canceled) return;
location.reload();
}
}
}); });
</script> </script>