diff --git a/src/renderer/components/dock/pod-logs.store.ts b/src/renderer/components/dock/pod-logs.store.ts index d283c8f6d9..8a4e0a90e9 100644 --- a/src/renderer/components/dock/pod-logs.store.ts +++ b/src/renderer/components/dock/pod-logs.store.ts @@ -144,7 +144,7 @@ export class PodLogsStore extends DockTabStore { 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(); } diff --git a/src/renderer/components/dock/pod-logs.tsx b/src/renderer/components/dock/pod-logs.tsx index fb4968e371..85d4a1e6cb 100644 --- a/src/renderer/components/dock/pod-logs.tsx +++ b/src/renderer/components/dock/pod-logs.tsx @@ -38,7 +38,15 @@ export class PodLogs extends React.Component { 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; + } + }) ]); }