0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

Merge branch 'main' into composer_copy_paste

Dieser Commit ist enthalten in:
Angus McLeod 2023-03-15 10:48:18 +01:00 committet von GitHub
Commit c0ed596ff9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

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