File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -122,11 +122,25 @@ export default {
122122 this .isEditTweetModalActive = true ;
123123 },
124124
125- async onDeleteTweet () {
126- // @todo add dialog confirm
127- await this .deleteTweet (this .tweet .id );
128-
129- this .$router .push ({ name: ' feed' });
125+ onDeleteTweet () {
126+ this .$dialog .confirm ({
127+ title: ' Deleting tweet' ,
128+ message: ' Are you sure you want to <b>delete</b> your tweet? This action cannot be undone.' ,
129+ confirmText: ' Delete Tweet' ,
130+ type: ' is-danger' ,
131+ onConfirm: async () => {
132+ try {
133+ await this .deleteTweet (this .tweet .id );
134+ this .$toast .open (' Tweet deleted!' );
135+ this .$router .push ({ name: ' feed' });
136+ } catch {
137+ this .$toast .open ({
138+ message: ' Unable to delete tweet!' ,
139+ type: ' is-danger' ,
140+ });
141+ }
142+ }
143+ });
130144 },
131145
132146 showImageModal () {
You can’t perform that action at this time.
0 commit comments