[Chat] Fix footer logic (#10785)
This commit is contained in:
@@ -709,7 +709,13 @@ function getFooterState(
|
||||
convoState: ActiveConvoStates,
|
||||
hasAcceptOverride?: boolean,
|
||||
): FooterState {
|
||||
if (convoState.convo.view.status === 'request' && !hasAcceptOverride) {
|
||||
const isRequest =
|
||||
convoState.convo.view.status === 'request' && !hasAcceptOverride
|
||||
|
||||
// For group chats, the request footer is driven purely off status: the owner
|
||||
// is always 'accepted' so never sees it, while members the owner added are
|
||||
// 'request' until they accept. This holds even before any messages load.
|
||||
if (convoState.convo.kind === 'group' && isRequest) {
|
||||
return 'request'
|
||||
}
|
||||
|
||||
@@ -721,6 +727,15 @@ function getFooterState(
|
||||
}
|
||||
}
|
||||
|
||||
// For direct chats, only show the request footer once there's a message. The
|
||||
// viewer's status stays 'request' until they send their first message, so an
|
||||
// empty direct request is one the viewer started themselves (show the
|
||||
// composer), whereas any message present must be an incoming one from the
|
||||
// other user (show the accept/reject footer).
|
||||
if (isRequest) {
|
||||
return 'request'
|
||||
}
|
||||
|
||||
return 'standard'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user