1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-25 00:24:11 +02:00

[Client] Improve alert component

This commit is contained in:
syuilo
2018-11-14 16:30:58 +09:00
parent 850396e9da
commit 11afa8140c
31 changed files with 268 additions and 672 deletions

View File

@@ -48,15 +48,15 @@ export default Vue.extend({
},
remove(i) {
this.$swal({
this.$root.alert({
type: 'warning',
text: this.$t('_remove.are-you-sure').replace('$1', this.announcements.find((_, j) => j == i).title),
showCancelButton: true
}).then(res => {
if (!res.value) return;
if (!res) return;
this.announcements = this.announcements.filter((_, j) => j !== i);
this.save(true);
this.$swal({
this.$root.alert({
type: 'success',
text: this.$t('_remove.removed')
});
@@ -68,13 +68,13 @@ export default Vue.extend({
broadcasts: this.announcements
}).then(() => {
if (!silent) {
this.$swal({
this.$root.alert({
type: 'success',
text: this.$t('saved')
});
}
}).catch(e => {
this.$swal({
this.$root.alert({
type: 'error',
text: e
});