From: Olaf Wintermann Date: Mon, 8 Sep 2025 05:45:57 +0000 (+0200) Subject: don't update the UI when no pending feeds were synced X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=7dd63eb9a420fd02aaba2abe7d75b91da6a3e515;p=rssreader.git don't update the UI when no pending feeds were synced --- 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()