FIX: "Sorry an error has occurred" was shown when flagging a post (#10948)

FIX: “Sorry an error has occurred” was shown when flagging a post (#10948)

diff --git a/app/assets/javascripts/discourse/app/controllers/flag.js b/app/assets/javascripts/discourse/app/controllers/flag.js
index 740af8c..22cc684 100644
--- a/app/assets/javascripts/discourse/app/controllers/flag.js
+++ b/app/assets/javascripts/discourse/app/controllers/flag.js
@@ -245,7 +245,7 @@ export default Controller.extend(ModalFunctionality, {
       postAction
         .act(this.model, params)
         .then(() => {
-          if (!opts.skipClose) {
+          if (!params.skipClose) {
             this.send("closeModal");
           }
           if (params.message) {

GitHub sha: 1ac010db

This commit appears in #10948 which was approved by riking. It was merged by gschlager.