mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-01 11:46:57 +01:00
Cleanup and add changelog
This commit is contained in:
parent
9b02704d5b
commit
3287980109
1
changelog.d/4057.feature
Normal file
1
changelog.d/4057.feature
Normal file
@ -0,0 +1 @@
|
||||
Improve space invite bottom sheet
|
@ -61,16 +61,18 @@ class SpaceInviteBottomSheetViewModel @AssistedInject constructor(
|
||||
peopleYouKnow = Success(peopleYouKnow)
|
||||
)
|
||||
}
|
||||
refreshInviteSummaryIfNeeded(roomSummary)
|
||||
if (roomSummary.membership == Membership.INVITE) {
|
||||
getLatestRoomSummary(roomSummary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun refreshInviteSummaryIfNeeded(roomSummary: RoomSummary) {
|
||||
if (roomSummary.membership == Membership.INVITE) {
|
||||
// we can try to query the room summary api to get more info?
|
||||
/**
|
||||
* Try to request the room summary api to get more info
|
||||
*/
|
||||
private fun getLatestRoomSummary(roomSummary: RoomSummary) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
when (val peekResult = tryOrNull { session.peekRoom(roomSummary.roomId) }) {
|
||||
is PeekResult.Success -> {
|
||||
val peekResult = tryOrNull { session.peekRoom(roomSummary.roomId) } as? PeekResult.Success ?: return@launch
|
||||
setState {
|
||||
copy(
|
||||
summary = Success(
|
||||
@ -87,12 +89,7 @@ class SpaceInviteBottomSheetViewModel @AssistedInject constructor(
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
// nop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user