calendar: Simplify code a bit
Just make the error case the same as the no-appointments one. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
This commit is contained in:
parent
c765082f72
commit
2ff7a78b56
@ -237,8 +237,7 @@ var DBusEventSource = class DBusEventSource {
|
||||
|
||||
_onEventsReceived(results, error) {
|
||||
let newEvents = [];
|
||||
let appointments = results[0] || null;
|
||||
if (appointments != null) {
|
||||
let appointments = results[0] || [];
|
||||
for (let n = 0; n < appointments.length; n++) {
|
||||
let a = appointments[n];
|
||||
let date = new Date(a[4] * 1000);
|
||||
@ -250,7 +249,6 @@ var DBusEventSource = class DBusEventSource {
|
||||
newEvents.push(event);
|
||||
}
|
||||
newEvents.sort((ev1, ev2) => ev1.date.getTime() - ev2.date.getTime());
|
||||
}
|
||||
|
||||
this._events = newEvents;
|
||||
this.isLoading = false;
|
||||
|
Loading…
Reference in New Issue
Block a user