mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-20 15:56:35 +00:00
fix safari es6 bug (#950)
and also at least log the error we catch. (don't know why the catch is there, so not removing it)
This commit is contained in:
parent
73608a73e7
commit
26b9ddf3ed
@ -4,6 +4,8 @@
|
|||||||
<link rel='import' href='../../src/util/hass-util.html'>
|
<link rel='import' href='../../src/util/hass-util.html'>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
|
||||||
{
|
{
|
||||||
const RECENT_THRESHOLD = 60000; // 1 minute
|
const RECENT_THRESHOLD = 60000; // 1 minute
|
||||||
const RECENT_CACHE = {};
|
const RECENT_CACHE = {};
|
||||||
@ -14,7 +16,6 @@
|
|||||||
function computeHistory(stateHistory, localize, language) {
|
function computeHistory(stateHistory, localize, language) {
|
||||||
const lineChartDevices = {};
|
const lineChartDevices = {};
|
||||||
const timelineDevices = [];
|
const timelineDevices = [];
|
||||||
|
|
||||||
if (!stateHistory) {
|
if (!stateHistory) {
|
||||||
return { line: [], timeline: [] };
|
return { line: [], timeline: [] };
|
||||||
}
|
}
|
||||||
@ -310,7 +311,9 @@
|
|||||||
}
|
}
|
||||||
return cache.data;
|
return cache.data;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((err) => {
|
||||||
|
/* eslint-disable no-console */
|
||||||
|
console.error(err);
|
||||||
window.stateHistoryCache[cacheKey] = undefined;
|
window.stateHistoryCache[cacheKey] = undefined;
|
||||||
});
|
});
|
||||||
cache.prom = prom;
|
cache.prom = prom;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user