[Client] Improve UI

This commit is contained in:
syuilo 2018-11-14 20:36:15 +09:00
parent 76a9ea8d3d
commit 7a2ef04ec3
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
3 changed files with 34 additions and 15 deletions

View File

@ -93,11 +93,18 @@ export default Vue.extend({
},
del() {
if (!window.confirm(this.$t('delete-confirm'))) return;
this.$root.api('notes/delete', {
noteId: this.note.id
}).then(() => {
this.destroyDom();
this.$root.alert({
type: 'warning',
text: this.$t('delete-confirm'),
showCancelButton: true
}).then(res => {
if (!res) return;
this.$root.api('notes/delete', {
noteId: this.note.id
}).then(() => {
this.destroyDom();
});
});
},

View File

@ -73,13 +73,20 @@ export default Vue.extend({
},
block() {
if (!window.confirm(this.$t('block-confirm'))) return;
this.$root.api('blocking/create', {
userId: this.user.id
}).then(() => {
this.user.isBlocking = true;
}, () => {
alert('error');
this.$root.alert({
type: 'warning',
text: this.$t('block-confirm'),
showCancelButton: true
}).then(res => {
if (!res) return;
this.$root.api('blocking/create', {
userId: this.user.id
}).then(() => {
this.user.isBlocking = true;
}, () => {
alert('error');
});
});
},

View File

@ -23,10 +23,15 @@ export default Vue.extend({
},
methods: {
fn() {
const ok = window.confirm(this.$t('read-all'));
if (!ok) return;
this.$root.alert({
type: 'warning',
text: this.$t('read-all'),
showCancelButton: true
}).then(res => {
if (!res) return;
this.$root.api('notifications/mark_all_as_read');
this.$root.api('notifications/mark_all_as_read');
});
},
onFetched() {
Progress.done();