mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 20:26:39 +00:00
Merge pull request #4895 from scop/sort-available-events
Sort list of available events
This commit is contained in:
commit
52ea3a5ce8
@ -1,6 +1,7 @@
|
||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||
|
||||
import { compare } from "../../../common/string/compare";
|
||||
import { EventsMixin } from "../../../mixins/events-mixin";
|
||||
import LocalizeMixin from "../../../mixins/localize-mixin";
|
||||
|
||||
@ -58,7 +59,7 @@ class EventsList extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
||||
super.connectedCallback();
|
||||
this.hass.callApi("GET", "events").then(
|
||||
function(events) {
|
||||
this.events = events;
|
||||
this.events = events.sort((e1, e2) => compare(e1.event, e2.event));
|
||||
}.bind(this)
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user