Improve usability

This commit is contained in:
syuilo 2019-02-28 12:29:04 +09:00
parent 1dbce5e3e2
commit 9c363ff045
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
3 changed files with 48 additions and 6 deletions

View File

@ -38,6 +38,7 @@ common:
signin: "ログイン" signin: "ログイン"
signup: "新規登録" signup: "新規登録"
signout: "ログアウト" signout: "ログアウト"
reload-to-apply-the-setting: "この設定を反映するにはページをリロードする必要があります。今すぐリロードしますか?"
got-it: "わかった" got-it: "わかった"
customization-tips: customization-tips:

View File

@ -463,17 +463,26 @@ export default Vue.extend({
circleIcons: { circleIcons: {
get() { return this.$store.state.settings.circleIcons; }, get() { return this.$store.state.settings.circleIcons; },
set(value) { this.$store.dispatch('settings/set', { key: 'circleIcons', value }); } set(value) {
this.$store.dispatch('settings/set', { key: 'circleIcons', value });
this.reload();
}
}, },
contrastedAcct: { contrastedAcct: {
get() { return this.$store.state.settings.contrastedAcct; }, get() { return this.$store.state.settings.contrastedAcct; },
set(value) { this.$store.dispatch('settings/set', { key: 'contrastedAcct', value }); } set(value) {
this.$store.dispatch('settings/set', { key: 'contrastedAcct', value });
this.reload();
}
}, },
showFullAcct: { showFullAcct: {
get() { return this.$store.state.settings.showFullAcct; }, get() { return this.$store.state.settings.showFullAcct; },
set(value) { this.$store.dispatch('settings/set', { key: 'showFullAcct', value }); } set(value) {
this.$store.dispatch('settings/set', { key: 'showFullAcct', value });
this.reload();
}
}, },
showVia: { showVia: {
@ -517,6 +526,17 @@ export default Vue.extend({
}); });
}, },
methods: { methods: {
reload() {
this.$root.dialog({
type: 'warning',
text: this.$t('@.reload-to-apply-the-setting'),
showCancelButton: true
}).then(({ canceled }) => {
if (!canceled) {
location.reload();
}
});
},
customizeHome() { customizeHome() {
location.href = '/?customize'; location.href = '/?customize';
}, },

View File

@ -308,7 +308,10 @@ export default Vue.extend({
circleIcons: { circleIcons: {
get() { return this.$store.state.settings.circleIcons; }, get() { return this.$store.state.settings.circleIcons; },
set(value) { this.$store.dispatch('settings/set', { key: 'circleIcons', value }); } set(value) {
this.$store.dispatch('settings/set', { key: 'circleIcons', value });
this.reload();
}
}, },
lineWidth: { lineWidth: {
@ -318,12 +321,18 @@ export default Vue.extend({
contrastedAcct: { contrastedAcct: {
get() { return this.$store.state.settings.contrastedAcct; }, get() { return this.$store.state.settings.contrastedAcct; },
set(value) { this.$store.dispatch('settings/set', { key: 'contrastedAcct', value }); } set(value) {
this.$store.dispatch('settings/set', { key: 'contrastedAcct', value });
this.reload();
}
}, },
showFullAcct: { showFullAcct: {
get() { return this.$store.state.settings.showFullAcct; }, get() { return this.$store.state.settings.showFullAcct; },
set(value) { this.$store.dispatch('settings/set', { key: 'showFullAcct', value }); } set(value) {
this.$store.dispatch('settings/set', { key: 'showFullAcct', value });
this.reload();
}
}, },
showVia: { showVia: {
@ -396,6 +405,18 @@ export default Vue.extend({
this.$root.signout(); this.$root.signout();
}, },
reload() {
this.$root.dialog({
type: 'warning',
text: this.$t('@.reload-to-apply-the-setting'),
showCancelButton: true
}).then(({ canceled }) => {
if (!canceled) {
location.reload();
}
});
},
checkForUpdate() { checkForUpdate() {
this.checkingForUpdate = true; this.checkingForUpdate = true;
checkForUpdate(this.$root, true, true).then(newer => { checkForUpdate(this.$root, true, true).then(newer => {