From 8d2c5e75d96b9b5c77e84c2e3d23c74dedaeb3b8 Mon Sep 17 00:00:00 2001 From: HF Date: Sat, 11 Jan 2020 02:00:33 +0100 Subject: [PATCH] also list midnight full-backup in historical view --- .eslintrc.json | 1 + src/components/HistorySelect.jsx | 5 ++++- src/ui/Renderer.js | 9 +++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index cffb9fbc..279c9c71 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -30,6 +30,7 @@ "react/jsx-one-expression-per-line": "off", "react/jsx-closing-tag-location":"off", "jsx-a11y/click-events-have-key-events":"off", + "no-continue": "off", "lines-between-class-members":["warn", "always",{"exceptAfterSingleLine": true}] } } diff --git a/src/components/HistorySelect.jsx b/src/components/HistorySelect.jsx index c68c540a..92ecf5f7 100644 --- a/src/components/HistorySelect.jsx +++ b/src/components/HistorySelect.jsx @@ -23,7 +23,10 @@ async function getTimes(day, canvasId) { const times = await response.json(); const parsedTimes = times .map((a) => `${a.substr(0, 2)}:${a.substr(-2, 2)}`); - return parsedTimes; + return [ + "00:00", + ...parsedTimes, + ]; } catch { return []; } diff --git a/src/ui/Renderer.js b/src/ui/Renderer.js index 6ca1dc29..459c6df1 100644 --- a/src/ui/Renderer.js +++ b/src/ui/Renderer.js @@ -102,7 +102,11 @@ class Renderer { } updateOldHistoricalTime(historicalTime: string) { - this.oldHistoricalTime = historicalTime; + if (historicalTime === '0000') { + this.oldHistoricalTime = null; + } else { + this.oldHistoricalTime = historicalTime; + } } updateScale( @@ -443,7 +447,7 @@ class Renderer { context.imageSmoothingEnabled = true; } - const scale = (viewscale > SCALE_THREASHOLD) ? 1.0 : viewscale; + const scale = (viewscale > SCALE_THREASHOLD) ? 1.0 : viewscale; // define how many chunks we will render // don't render chunks outside of viewport const { width, height } = viewport; @@ -514,6 +518,7 @@ class Renderer { } } // incremential chunks + if (historicalTime === '0000') continue; key = ChunkRGB.getKey(`${historicalDate}${historicalTime}`, cx, cy); chunk = chunks.get(key); if (chunk) {