fix null items and log if event is null
This commit is contained in:
parent
6e6135c53b
commit
12e1d64660
1 changed files with 8 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Services.Notifications
|
import Quickshell.Services.Notifications
|
||||||
|
|
||||||
|
|
@ -31,9 +32,14 @@ Singleton {
|
||||||
if (!root.enabled) {
|
if (!root.enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event == null) {
|
||||||
|
console.log("Event is null?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
event.tracked = true;
|
event.tracked = true;
|
||||||
root.list = root.list.filter(item => item.id != event.id);
|
root.list = root.list.filter(item => item != null && item.id != event.id).push(event);
|
||||||
root.list.push(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue