Fix parseModuleJson undefined call in custom command modules

CustomCommandModule.update() in Bar.qml called root.parseModuleJson(raw)
but the function was removed in 3b970068 (the indicator split). Any
custom command module emitting waybar-style JSON would have crashed on
first poll.

Hoist the helper into Util so both call sites — the bar's custom command
module and BarIndicator.extractData — share one definition.
This commit is contained in:
David Heinemeier Hansson
2026-05-20 19:46:47 +02:00
parent e29394a133
commit 9baf3f7f79
3 changed files with 16 additions and 10 deletions
+1 -9
View File
@@ -18,15 +18,7 @@ WidgetButton {
readonly property bool inactiveRevealed: !effectiveActive && !!indicatorHost && indicatorHost.revealInactiveIndicators
function extractData(raw) {
var text = String(raw || "").trim()
if (text === "") return {}
var lines = text.split("\n")
try {
return JSON.parse(lines[lines.length - 1])
} catch (error) {
return { text: text }
}
return Util.parseModuleJson(raw)
}
function syncIndicatorOpacity() {