mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Do not show unknown data.
This commit is contained in:
parent
8f927a46ca
commit
366ce8665d
@ -38,8 +38,8 @@ data class HomeDetailViewState(
|
||||
val notificationCountRooms: Int = 0,
|
||||
val notificationHighlightRooms: Boolean = false,
|
||||
val hasUnreadMessages: Boolean = false,
|
||||
val syncState: SyncState = SyncState.Idle,
|
||||
val incrementalSyncRequestState: SyncRequestState.IncrementalSyncRequestState = SyncRequestState.IncrementalSyncIdle,
|
||||
val syncState: SyncState? = null,
|
||||
val incrementalSyncRequestState: SyncRequestState.IncrementalSyncRequestState? = null,
|
||||
val pushCounter: Int = 0,
|
||||
val pstnSupportFlag: Boolean = false,
|
||||
val forceDialPadTab: Boolean = false
|
||||
|
@ -60,8 +60,8 @@ data class RoomDetailViewState(
|
||||
val formattedTypingUsers: String? = null,
|
||||
val tombstoneEvent: Event? = null,
|
||||
val joinUpgradedRoomAsync: Async<String> = Uninitialized,
|
||||
val syncState: SyncState = SyncState.Idle,
|
||||
val incrementalSyncRequestState: SyncRequestState.IncrementalSyncRequestState = SyncRequestState.IncrementalSyncIdle,
|
||||
val syncState: SyncState? = null,
|
||||
val incrementalSyncRequestState: SyncRequestState.IncrementalSyncRequestState? = null,
|
||||
val pushCounter: Int = 0,
|
||||
val highlightedEventId: String? = null,
|
||||
val unreadState: UnreadState = UnreadState.Unknown,
|
||||
|
@ -40,8 +40,8 @@ class SyncStateView @JvmOverloads constructor(context: Context, attrs: Attribute
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun render(
|
||||
newState: SyncState,
|
||||
incrementalSyncRequestState: SyncRequestState.IncrementalSyncRequestState,
|
||||
newState: SyncState?,
|
||||
incrementalSyncRequestState: SyncRequestState.IncrementalSyncRequestState?,
|
||||
pushCounter: Int,
|
||||
showDebugInfo: Boolean
|
||||
) {
|
||||
@ -64,8 +64,9 @@ class SyncStateView @JvmOverloads constructor(context: Context, attrs: Attribute
|
||||
}
|
||||
}
|
||||
|
||||
private fun SyncState.toHumanReadable(): String {
|
||||
private fun SyncState?.toHumanReadable(): String {
|
||||
return when (this) {
|
||||
null -> "Unknown"
|
||||
SyncState.Idle -> "Idle"
|
||||
SyncState.InvalidToken -> "InvalidToken"
|
||||
SyncState.Killed -> "Killed"
|
||||
@ -76,8 +77,9 @@ class SyncStateView @JvmOverloads constructor(context: Context, attrs: Attribute
|
||||
}
|
||||
}
|
||||
|
||||
private fun SyncRequestState.IncrementalSyncRequestState.toHumanReadable(): String {
|
||||
private fun SyncRequestState.IncrementalSyncRequestState?.toHumanReadable(): String {
|
||||
return when (this) {
|
||||
null -> "Unknown"
|
||||
SyncRequestState.IncrementalSyncIdle -> "Idle"
|
||||
is SyncRequestState.IncrementalSyncParsing -> "Parsing ${this.rooms} room(s) ${this.toDevice} toDevice(s)"
|
||||
SyncRequestState.IncrementalSyncError -> "Error"
|
||||
|
Loading…
Reference in New Issue
Block a user