]> uap-core.de Git - rssreader.git/commitdiff
don't update the UI when no pending feeds were synced
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 8 Sep 2025 05:45:57 +0000 (07:45 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 8 Sep 2025 05:45:57 +0000 (07:45 +0200)
rss-application/src/main/kotlin/de/unixwork/rssreader/App.kt

index ee096282df54f608c7aadc80460045af6b3d1fc9..cd127fa0caca5602cb30286430a0e5f5b107cbe3 100644 (file)
@@ -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()