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

This commit is contained in:
Mark VanLandingham 2021-06-29 13:59:32 -05:00 committed by GitHub
parent aa56e2a758
commit e870c09438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -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);