Properly style call buttons across app, when already in a call

This commit is contained in:
Scott Nonnenberg 2024-08-27 06:48:41 +10:00 committed by GitHub
parent 3c25092f50
commit c251867699
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 610 additions and 189 deletions

View file

@ -56,7 +56,7 @@ const useOutgoingCallButtonStyle = (
const callSelector = useSelector(getCallSelector);
strictAssert(ourAci, 'useOutgoingCallButtonStyle missing our uuid');
if (activeCall != null) {
if (activeCall?.conversationId === conversation.id) {
return OutgoingCallButtonStyle.None;
}
@ -100,6 +100,8 @@ export const SmartConversationHeader = memo(function SmartConversationHeader({
const hasPanelShowing = useSelector(getHasPanelOpen);
const outgoingCallButtonStyle = useOutgoingCallButtonStyle(conversation);
const theme = useSelector(getTheme);
const activeCall = useSelector(getActiveCallState);
const hasActiveCall = Boolean(activeCall);
const {
destroyMessages,
@ -264,6 +266,7 @@ export const SmartConversationHeader = memo(function SmartConversationHeader({
cannotLeaveBecauseYouAreLastAdmin={cannotLeaveBecauseYouAreLastAdmin}
conversation={minimalConversation}
conversationName={conversationName}
hasActiveCall={hasActiveCall}
hasPanelShowing={hasPanelShowing}
hasStories={hasStories}
i18n={i18n}