mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-28 16:47:13 +09:00
Fix offSlaveUpdate and offSaveListUpdate
Fix unreachable code and use of slice instead splice turning offSlaveUpdate and offSaveListUpdate into no-ops.
This commit is contained in:
1 parent
049ccee94e
commit
9aebeeac02
1 file changed
+2
-2
@@ -133,7 +133,7 @@ export class Control extends libLink.Link {
|
||||
throw new Error(`Given handler is not registered for slave ${id}`);
|
||||
}
|
||||
|
||||
handlers.slice(index, 1);
|
||||
handlers.splice(index, 1);
|
||||
if (!handlers.length) {
|
||||
this.slaveUpdateHandlers.delete(id);
|
||||
await this.updateSlaveSubscriptions();
|
||||
@@ -242,6 +242,7 @@ export class Control extends libLink.Link {
|
||||
let index = handlers.lastIndexOf(handler);
|
||||
if (index === -1) {
|
||||
throw new Error(`Given handler is not registered for instance ${id}`);
|
||||
}
|
||||
|
||||
handlers.splice(index, 1);
|
||||
if (!handlers.length) {
|
||||
@@ -249,7 +250,6 @@ export class Control extends libLink.Link {
|
||||
await this.updateSaveListSubscriptions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async updateSaveListSubscriptions() {
|
||||
if (!this.connector.connected) {
|
||||
|
||||
Reference in new issue
Block a user