Fix default conversation color to use state

This commit is contained in:
ayumi-signal 2023-09-01 10:03:44 -07:00 committed by GitHub
parent f3eee779a0
commit cf28e2dc2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 16 deletions

View file

@ -12,6 +12,7 @@ import {
getConversationsWithCustomColorSelector,
} from '../selectors/conversations';
import { getIntl } from '../selectors/user';
import { getDefaultConversationColor } from '../selectors/items';
import { getConversationColorAttributes } from '../../util/getConversationColorAttributes';
export type SmartChatColorPickerProps = {
@ -25,7 +26,11 @@ const mapStateToProps = (
const conversation = props.conversationId
? getConversationSelector(state)(props.conversationId)
: {};
const colorValues = getConversationColorAttributes(conversation);
const defaultConversationColor = getDefaultConversationColor(state);
const colorValues = getConversationColorAttributes(
conversation,
defaultConversationColor
);
const { customColors } = state.items;

View file

@ -21,7 +21,11 @@ import {
getTheme,
getUserConversationId,
} from '../selectors/user';
import { getEmojiSkinTone, getTextFormattingEnabled } from '../selectors/items';
import {
getDefaultConversationColor,
getEmojiSkinTone,
getTextFormattingEnabled,
} from '../selectors/items';
import {
getConversationSelector,
getGroupAdminsSelector,
@ -169,6 +173,7 @@ const mapStateToProps = (state: StateType, props: ExternalProps) => {
? getPropsForQuote(quotedMessage, {
conversationSelector,
ourConversationId: getUserConversationId(state),
defaultConversationColor: getDefaultConversationColor(state),
})
: undefined,
quotedMessageAuthorAci: quotedMessage?.quote?.authorAci,

View file

@ -16,7 +16,10 @@ import {
} from '../selectors/conversations';
import { getGroupMemberships } from '../../util/getGroupMemberships';
import { getActiveCallState } from '../selectors/calling';
import { getAreWeASubscriber } from '../selectors/items';
import {
getAreWeASubscriber,
getDefaultConversationColor,
} from '../selectors/items';
import { getIntl, getTheme } from '../selectors/user';
import {
getBadgesSelector,
@ -82,6 +85,7 @@ const mapStateToProps = (
);
const badges = getBadgesSelector(state)(conversation.badges);
const defaultConversationColor = getDefaultConversationColor(state);
const groupsInCommon =
conversation.type === 'direct'
@ -107,7 +111,7 @@ const mapStateToProps = (
canAddNewMembers,
conversation: {
...conversation,
...getConversationColorAttributes(conversation),
...getConversationColorAttributes(conversation, defaultConversationColor),
},
getPreferredBadge: getPreferredBadgeSelector(state),
hasActiveCall: Boolean(getActiveCallState(state)),