diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-08-05 10:30:31 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-08-05 10:30:31 +0900 |
| commit | 3b626f72e4998640e4e973e6212195cf0e5ad727 (patch) | |
| tree | 2eb4d5e6d6811f4a920812617008b2662b71902b /src/client | |
| parent | Update README.md [AUTOGEN] (#5246) (diff) | |
| download | sharkey-3b626f72e4998640e4e973e6212195cf0e5ad727.tar.gz sharkey-3b626f72e4998640e4e973e6212195cf0e5ad727.tar.bz2 sharkey-3b626f72e4998640e4e973e6212195cf0e5ad727.zip | |
Resolve #5247 (#5248)
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/common/scripts/note-mixin.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts index fc82e78cec..e433ba49cf 100644 --- a/src/client/app/common/scripts/note-mixin.ts +++ b/src/client/app/common/scripts/note-mixin.ts @@ -4,6 +4,7 @@ import shouldMuteNote from './should-mute-note'; import MkNoteMenu from '../views/components/note-menu.vue'; import MkReactionPicker from '../views/components/reaction-picker.vue'; import pleaseLogin from './please-login'; +import i18n from '../../i18n'; function focus(el, fn) { const target = fn(el); @@ -21,6 +22,8 @@ type Opts = { }; export default (opts: Opts = {}) => ({ + i18n: i18n(), + data() { return { showContent: false, @@ -175,8 +178,16 @@ export default (opts: Opts = {}) => ({ }, del() { - this.$root.api('notes/delete', { - noteId: this.appearNote.id + this.$root.dialog({ + type: 'warning', + text: this.$t('@.delete-confirm'), + showCancelButton: true + }).then(({ canceled }) => { + if (canceled) return; + + this.$root.api('notes/delete', { + noteId: this.appearNote.id + }); }); }, |