Commit 81023221 authored by Kiryl Vashyla's avatar Kiryl Vashyla

PR #1615 fixes

parent c8ec586b
......@@ -160,8 +160,7 @@ class ChatRoomAdapter(
return@filter (matchedIndex < 0)
}
//At the second stage we are inserting new received elements into set.
if (filteredDataSet.size == 0)
return
if (filteredDataSet.isEmpty()) return
this.dataSet.addAll(0, filteredDataSet)
val tmp = this.dataSet.sortedWith(Comparator { t, t2 -> t.message.timestamp.compareTo(t2.message.timestamp) }).reversed()
this.dataSet.clear()
......
......@@ -9,8 +9,8 @@ class MemoryMessagesRepository : MessagesRepository {
private var lastSyncDate: Long? = null
override suspend fun saveLastSyncDate(it: Long) {
lastSyncDate = it
override suspend fun saveLastSyncDate(currentTimeMillis: Long) {
lastSyncDate = currentTimeMillis
}
override suspend fun getLastSyncDate() = lastSyncDate
......
......@@ -27,7 +27,6 @@ class SharedPreferencesMessagesRepository(
currentServerInteractor.get()?.also { server ->
if (!prefs.contains(getSyncDateKey(server)))
return@withContext null
//
val time = prefs.getLong(getSyncDateKey(server), -1)
return@withContext if (time == -1L) null else time
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment