diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index 3efa325dd4..1feb719779 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -121,8 +121,8 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment { ID_MENU_CLEAR_LOG -> { nsClientPlugin?.listLog?.let { synchronized(it) { - logAdapter.notifyItemRangeRemoved(0, it.size) it.clear() + _binding?.recyclerview?.swapAdapter(RecyclerViewAdapter(it), true) } } true diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt index 0217179ea4..f428594fa3 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -67,7 +67,6 @@ class LoadTreatmentsWorker( nsClientV3Plugin.storeLastLoadedSrvModified() } rxBus.send(EventNSClientNewLog("◄ RCV TR END", "No data from ${dateUtil.dateAndTimeAndSecondsString(lastLoaded)}")) - storeDataForDb.storeTreatmentsToDb() continueLoading = false } } else { @@ -77,7 +76,6 @@ class LoadTreatmentsWorker( nsClientV3Plugin.storeLastLoadedSrvModified() } rxBus.send(EventNSClientNewLog("◄ RCV TR END", "No new data from ${dateUtil.dateAndTimeAndSecondsString(lastLoaded)}")) - storeDataForDb.storeTreatmentsToDb() continueLoading = false } } @@ -88,6 +86,7 @@ class LoadTreatmentsWorker( return Result.failure(workDataOf("Error" to error.localizedMessage)) } + storeDataForDb.storeTreatmentsToDb() nsClientV3Plugin.lastOperationError = null return Result.success() }