Commit bbbde760 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Fix clearing kde connect devices on disconnect

Cannot iterate an Object using for..of, luckily all of this was done in a try..catch
so no real harm was done :)
parent 2ce261b1
......@@ -165,13 +165,16 @@ function connectHost() {
// Remove all kde connect menu entries since they won't work without a host
try {
for (let device of kdeConnectDevices) {
for (let device in kdeConnectDevices) {
if (!kdeConnectDevices.hasOwnProperty(device)) {
continue;
}
chrome.contextMenus.remove(kdeConnectMenuIdPrefix + device);
}
} catch (e) {
console.warn("Failed to cleanup after port disconnect", e);
}
kdeConnectDevices = [];
kdeConnectDevices = {};
if (receivedMessageOnce) {
portLastErrorMessage = error && error.message || "UNKNOWN";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment