1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Hide JumpToBottom btn on error

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-10-16 10:59:23 +03:00
parent 05bb346e7b
commit e2324aebe2
2 changed files with 10 additions and 2 deletions

View File

@ -144,7 +144,7 @@ export class PodLogsStore extends DockTabStore<IPodLogsData> {
getLastSinceTime(tabId: TabId) {
const logs = this.logs.get(tabId);
const timestamps = this.getTimestamps(logs[logs.length - 1]);
const stamp = new Date(timestamps[0]);
const stamp = new Date(timestamps ? timestamps[0] : null);
stamp.setSeconds(stamp.getSeconds() + 1); // avoid duplicates from last second
return stamp.toISOString();
}

View File

@ -38,7 +38,15 @@ export class PodLogs extends React.Component<Props> {
return;
}
await this.load();
}, { fireImmediately: true })
}, { fireImmediately: true }),
// Check if need to show JumpToBottom if new log amount is less than previous one
reaction(() => podLogsStore.logs.get(this.tabId), () => {
const { tabId } = this;
if (podLogsStore.logs.has(tabId) && podLogsStore.logs.get(tabId).length < logRange) {
this.showJumpToBottom = false;
}
})
]);
}