From 7dd63eb9a420fd02aaba2abe7d75b91da6a3e515 Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Mon, 8 Sep 2025 07:45:57 +0200 Subject: [PATCH] don't update the UI when no pending feeds were synced --- .../src/main/kotlin/de/unixwork/rssreader/App.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt b/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt index ee09628..cd127fa 100644 --- a/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt +++ b/rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt @@ -51,11 +51,13 @@ class App : Application { println("Background sync") try { val pending = Database.getPendingFeeds(1 * 60) - SyncJob { pending }.syncBlocking() - GlobalScope.launch(ToolkitDispatcher) { - window!!.sourceList.invalidateCache() - window!!.sourceList.reloadStatus() - window!!.feedList.reloadCurrentFeed() + if(!pending.isEmpty()) { + SyncJob { pending }.syncBlocking() + GlobalScope.launch(ToolkitDispatcher) { + window!!.sourceList.invalidateCache() + window!!.sourceList.reloadStatus() + window!!.feedList.reloadCurrentFeed() + } } } catch (e: Exception) { e.printStackTrace() -- 2.47.3