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:
parent
05bb346e7b
commit
e2324aebe2
@ -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();
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user