Refactor Setting class to fix formatting and event handling

This commit is contained in:
Harvey Zack committed 2024-10-19 23:37:01 +08:00
1 parent e8c317051a
commit 49704ffc29
3 files changed
+7 -9

No files matched your search

+3 -4
View File
@@ -58,9 +58,7 @@ export default class Setting extends Component {
}
});
art.on('resize', () => {
this.resize();
});
art.on('resize', () => this.resize());
}
}
@@ -168,7 +166,8 @@ export default class Setting extends Component {
const target = this.find(setting.name);
if (target) {
Object.assign(target, setting);
this.reset();
this.format();
this.render();
} else {
this.add(setting);
}