From fc266a5d21df1a0bae0f96644c17166c0111c2f0 Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Wed, 1 Sep 2021 11:15:05 -0600 Subject: [PATCH] no logs conditional --- ui/src/app/components/logs/logs.page.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/app/components/logs/logs.page.ts b/ui/src/app/components/logs/logs.page.ts index 1e2bf2429..c4dac18a0 100644 --- a/ui/src/app/components/logs/logs.page.ts +++ b/ui/src/app/components/logs/logs.page.ts @@ -56,6 +56,8 @@ export class LogsPage { try { // get logs const logs = await this.fetch() + if (!logs.length) return + const container = document.getElementById('container') const beforeContainerHeight = container.scrollHeight const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement @@ -78,6 +80,8 @@ export class LogsPage { try { this.loadingMore = true const logs = await this.fetch(false) + if (!logs.length) return this.loadingMore = false + const container = document.getElementById('container') const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement newLogs.innerHTML = logs.map(l => `${l.timestamp} ${l.log}`).join('\n\n') + (logs.length ? '\n\n' : '')