FIX: Do not call 'set' in destroyed directory table component (#13567)

FIX: Do not call ‘set’ in destroyed directory table component (#13567)

diff --git a/app/assets/javascripts/discourse/app/components/directory-table.js b/app/assets/javascripts/discourse/app/components/directory-table.js
index f9c03ba..e92b884 100644
--- a/app/assets/javascripts/discourse/app/components/directory-table.js
+++ b/app/assets/javascripts/discourse/app/components/directory-table.js
@@ -57,7 +57,11 @@ export default Component.extend({
 
   @action
   onHorizontalScroll(primary, replica) {
-    if (this.lastScrollPosition === primary.scrollLeft) {
+    if (
+      this.isDestroying ||
+      this.isDestroyed ||
+      this.lastScrollPosition === primary.scrollLeft
+    ) {
       return;
     }
 
@@ -65,8 +69,10 @@ export default Component.extend({
 
     if (!this.ticking) {
       window.requestAnimationFrame(() => {
-        replica.scrollLeft = this.lastScrollPosition;
-        this.set("ticking", false);
+        if (!this.isDestroying && !this.isDestroyed) {
+          replica.scrollLeft = this.lastScrollPosition;
+          this.set("ticking", false);
+        }
       });
 
       this.set("ticking", true);

GitHub sha: e870c0943839e577a6b7397f519b5d03295b0354

This commit appears in #13567 which was approved by CvX. It was merged by markvanlan.