Skip to content

A platform for community discussion. Free, open, simple.

FIX: correctly makes `this` accessible in the scope (#23146)

Joffrey JAFFEUX4661bcb5ea5a
diff --git a/app/assets/javascripts/discourse/app/components/modal/history.js b/app/assets/javascripts/discourse/app/components/modal/history.js
index 069da8ea109..c31b85bc85b 100644
--- a/app/assets/javascripts/discourse/app/components/modal/history.js
+++ b/app/assets/javascripts/discourse/app/components/modal/history.js
@@ -203,7 +203,7 @@ export default class History extends Component {
}
this.args.closeModal();
})
- .catch(function (e) {
+ .catch((e) => {
if (e.jqXHR.responseJSON?.errors?.[0]) {
this.dialog.alert(e.jqXHR.responseJSON.errors[0]);
}