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:
NovapaX 2018-02-28 05:00:33 +01:00 committed by Paulus Schoutsen
parent 73608a73e7
commit 26b9ddf3ed

View File

@ -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;