diff --git a/Widgets/Sidebar/Panel/WifiPanel.qml b/Widgets/Sidebar/Panel/WifiPanel.qml index b02737b..fc88e0c 100644 --- a/Widgets/Sidebar/Panel/WifiPanel.qml +++ b/Widgets/Sidebar/Panel/WifiPanel.qml @@ -151,17 +151,16 @@ Item { function replaceQuickshell(ssid: string): string { const newName = ssid.replace("quickshell-", ""); - if (!ssid.startsWith("quickshell-")){ + if (!ssid.startsWith("quickshell-")) { return newName; } - if (newName in wifiLogic.networks){ + if (wifiLogic.networks && newName in wifiLogic.networks) { console.log(`Quickshell ${newName} already exists, deleting old profile`) deleteProfileProcess.connName = ssid; deleteProfileProcess.running = true; } - console.log(`Changing from ${ssid} to ${newName}`) renameConnectionProcess.oldName = ssid; renameConnectionProcess.newName = newName; @@ -256,17 +255,22 @@ Item { stdout: StdioCollector { onStreamFinished: { - console.log("Renamed connection '" + renameConnectionProcess.oldName + "' to '" + renameConnectionProcess.newName + "'"); + console.log("Successfully renamed connection '" + + renameConnectionProcess.oldName + "' to '" + + renameConnectionProcess.newName + "'"); } } stderr: StdioCollector { onStreamFinished: { - console.error("Error renaming connection '" + renameConnectionProcess.oldName + "':", text); + if (text.trim() !== "" && !text.toLowerCase().includes("warning")) { + console.error("Error renaming connection:", text); + } } } } + // Process to rename a connection Process { id: deleteProfileProcess