server: console fixes

This commit is contained in:
Koushik Dutta
2021-10-08 20:33:05 -07:00
parent 3efd9d682b
commit 3caef12e4e
6 changed files with 78 additions and 26 deletions

View File

@@ -539,12 +539,15 @@ export class ScryptedRuntime {
}
this.stateManager.removeDevice(device._id);
const plugin = this.plugins[device.pluginId];
// remove the plugin too
if (!device.nativeId) {
const plugin = this.plugins[device.pluginId];
plugin?.kill();
await this.datastore.removeId(Plugin, device.pluginId);
}
else {
await plugin.remote.setNativeId(device.nativeId, undefined, undefined);
}
}
upsertDevice(pluginId: string, device: Device, invalidate?: boolean): Promise<PluginDevice> {