FIX: use const instead of let for observedCache
Dieser Commit ist enthalten in:
Ursprung
52fe5166cd
Commit
20e7b492ea
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
|
@ -4,7 +4,7 @@ import { get, set } from "@ember/object";
|
||||||
import Mixin from "@ember/object/mixin";
|
import Mixin from "@ember/object/mixin";
|
||||||
import { deepEqual } from "discourse-common/lib/object";
|
import { deepEqual } from "discourse-common/lib/object";
|
||||||
|
|
||||||
let observedCache = [];
|
const observedCache = [];
|
||||||
|
|
||||||
export default Mixin.create({
|
export default Mixin.create({
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
|
@ -36,7 +36,10 @@ export default Mixin.create({
|
||||||
listProperties(componentType, opts).forEach((property) => {
|
listProperties(componentType, opts).forEach((property) => {
|
||||||
if (observedCache.includes(property)) {
|
if (observedCache.includes(property)) {
|
||||||
obj.removeObserver(property, this, this.toggleUndo);
|
obj.removeObserver(property, this, this.toggleUndo);
|
||||||
observedCache = observedCache.filter((p) => p !== property);
|
let index = observedCache.indexOf(property);
|
||||||
|
if (index !== -1) {
|
||||||
|
observedCache.splice(index, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Laden …
In neuem Issue referenzieren