Skip to content

Commit

Permalink
Do not use invalid X-Min/Max-Timestamp headers if not available
Browse files Browse the repository at this point in the history
  • Loading branch information
fracz committed May 3, 2020
1 parent 16d7604 commit c8bd1ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Frontend/src/channels/channel-measurements-history.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@
.then(({body: logItems, headers}) => {
if (logItems.length > 0) {
const maxTimestamp = headers.get('X-Max-Timestamp');
if (maxTimestamp > logItems[logItems.length - 1].date_timestamp) {
if (maxTimestamp && maxTimestamp > logItems[logItems.length - 1].date_timestamp) {
logItems.push({...logItems[logItems.length - 1], date_timestamp: maxTimestamp});
}
const minTimestamp = headers.get('X-Min-Timestamp');
if (minTimestamp < logItems[0].date_timestamp) {
if (minTimestamp && minTimestamp < logItems[0].date_timestamp) {
logItems.unshift({...logItems[0], date_timestamp: minTimestamp});
}
}
Expand Down

0 comments on commit c8bd1ec

Please sign in to comment.