mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 09:56:36 +00:00
Fix mailbox issues with this.fire() and this.language undefined (#1809)
* Fix bug with this.fire and this.language * Proper language variable
This commit is contained in:
parent
0970e1e33c
commit
fa637a37d5
@ -16,13 +16,14 @@ import "../../resources/ha-style.js";
|
|||||||
|
|
||||||
import formatDateTime from "../../common/datetime/format_date_time.js";
|
import formatDateTime from "../../common/datetime/format_date_time.js";
|
||||||
import LocalizeMixin from "../../mixins/localize-mixin.js";
|
import LocalizeMixin from "../../mixins/localize-mixin.js";
|
||||||
|
import EventsMixin from "../../mixins/events-mixin.js";
|
||||||
|
|
||||||
let registeredDialog = false;
|
let registeredDialog = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @appliesMixin LocalizeMixin
|
* @appliesMixin LocalizeMixin
|
||||||
*/
|
*/
|
||||||
class HaPanelMailbox extends LocalizeMixin(PolymerElement) {
|
class HaPanelMailbox extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
||||||
static get template() {
|
static get template() {
|
||||||
return html`
|
return html`
|
||||||
<style include='ha-style'>
|
<style include='ha-style'>
|
||||||
@ -206,13 +207,13 @@ class HaPanelMailbox extends LocalizeMixin(PolymerElement) {
|
|||||||
const platform = this.platforms[this._currentPlatform];
|
const platform = this.platforms[this._currentPlatform];
|
||||||
return this.hass
|
return this.hass
|
||||||
.callApi("GET", `mailbox/messages/${platform.name}`)
|
.callApi("GET", `mailbox/messages/${platform.name}`)
|
||||||
.then(function(values) {
|
.then((values) => {
|
||||||
const platformItems = [];
|
const platformItems = [];
|
||||||
const arrayLength = values.length;
|
const arrayLength = values.length;
|
||||||
for (let i = 0; i < arrayLength; i++) {
|
for (let i = 0; i < arrayLength; i++) {
|
||||||
const datetime = formatDateTime(
|
const datetime = formatDateTime(
|
||||||
new Date(values[i].info.origtime * 1000),
|
new Date(values[i].info.origtime * 1000),
|
||||||
this.language
|
this.hass.language
|
||||||
);
|
);
|
||||||
platformItems.push({
|
platformItems.push({
|
||||||
timestamp: datetime,
|
timestamp: datetime,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user