diff --git a/extensions/flags/js/forum/src/components/FlagPostModal.js b/extensions/flags/js/forum/src/components/FlagPostModal.js index 4478ebd6a..6681532e4 100644 --- a/extensions/flags/js/forum/src/components/FlagPostModal.js +++ b/extensions/flags/js/forum/src/components/FlagPostModal.js @@ -5,6 +5,8 @@ export default class FlagPostModal extends Modal { init() { super.init(); + this.success = false; + this.reason = m.prop(''); this.reasonDetail = m.prop(''); } @@ -18,6 +20,21 @@ export default class FlagPostModal extends Modal { } content() { + if (this.success) { + return ( +
+
+

{app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')}

+
+ +
+
+
+ ); + } + const guidelinesUrl = app.forum.attribute('guidelinesUrl'); return ( @@ -81,9 +98,8 @@ export default class FlagPostModal extends Modal { user: app.session.user, post: this.props.post } - }).then( - () => this.hide(), - this.loaded.bind(this) - ); + }) + .then(() => this.success = true) + .finally(this.loaded.bind(this)); } }