fix swaync notification parsing, use alt field
This commit is contained in:
parent
43c2541ccd
commit
784ded0a32
1 changed files with 4 additions and 4 deletions
|
|
@ -27,10 +27,10 @@ M.BarSection {
|
|||
onRead: line => {
|
||||
try {
|
||||
const d = JSON.parse(line);
|
||||
const cls = d.class ?? "";
|
||||
root.count = d.count ?? 0;
|
||||
root.dnd = cls.includes("dnd");
|
||||
root.inhibited = cls.includes("inhibited");
|
||||
const alt = d.alt ?? "";
|
||||
root.count = parseInt(d.text) || 0;
|
||||
root.dnd = alt.startsWith("dnd");
|
||||
root.inhibited = alt.includes("inhibited");
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue