Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ struct ConversationV10: Decodable, ToAPIModelConvertible {
case type
case groupType = "group_conv_type"
case addPermission = "add_permission"
case cellsState = "cells_state"
}

var access: Set<ConversationAccessModeV0>?
Expand All @@ -165,6 +166,7 @@ struct ConversationV10: Decodable, ToAPIModelConvertible {
var type: ConversationTypeV0?
var groupType: ConversationGroupTypeV8?
var addPermission: ChannelPermissionV8?
var cellsState: CellsStateV8

func toAPIModel() -> Conversation {
let access = access?.map { $0.toAPIModel() }
Expand All @@ -190,7 +192,8 @@ struct ConversationV10: Decodable, ToAPIModelConvertible {
lastEvent: lastEvent,
lastEventTime: lastEventTime?.date,
groupType: groupType?.toAPIModel(),
addPermission: addPermission?.toAPIModel()
addPermission: addPermission?.toAPIModel(),
cellsState: cellsState.toAPIModel()
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"group_id": "string",
"last_event": "string",
"last_event_time": "2024-06-04T15:03:07.598Z",
"cells_state": "disabled",
"members": {
"others": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"group_id": "string",
"last_event": "string",
"last_event_time": "2024-06-04T15:03:07.598Z",
"cells_state": "disabled",
"members": {
"others": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"group_id": "string",
"last_event": "string",
"last_event_time": "2024-06-04T15:03:07.598Z",
"cells_state": "disabled",
"members": {
"others": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"id": "99db9768-04e3-4b5d-9268-831b6a25c4ab",
"last_event": "string",
"last_event_time": "2024-06-04T15:03:07.598Z",
"cells_state": "disabled",
"members": {
"others": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"id": "99db9768-04e3-4b5d-9268-831b6a25c4ab",
"last_event": "string",
"last_event_time": "2024-06-04T15:03:07.598Z",
"cells_state": "disabled",
"members": {
"others": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ extension ConversationViewController {

isAppearing = false

syncCellsStateIfPending()
syncCellsState()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,10 @@ extension ConversationViewController: ConversationInputBarViewControllerDelegate
filesView.presentOverAll(animated: true)
}

/// If cells state is pending we need to sync it to ensure the value is up to date
/// as it might have been updated to a `ready` state.
func syncCellsStateIfPending() {
guard wireCellsState == .pending else {
/// If cells state is different than ready we need to sync it when view appears to ensure the value is up to date
/// as it might have been updated to either a `pending` or `ready` state.
func syncCellsState() {
guard wireCellsState != .ready else {
return
}

Expand Down
Loading