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
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Notifications
|
||||
|
||||
|
|
@ -31,9 +32,14 @@ Singleton {
|
|||
if (!root.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event == null) {
|
||||
console.log("Event is null?");
|
||||
return;
|
||||
}
|
||||
|
||||
event.tracked = true;
|
||||
root.list = root.list.filter(item => item.id != event.id);
|
||||
root.list.push(event);
|
||||
root.list = root.list.filter(item => item != null && item.id != event.id).push(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue