Fix default conversation color to use state
This commit is contained in:
parent
f3eee779a0
commit
cf28e2dc2c
6 changed files with 57 additions and 16 deletions
|
@ -1,21 +1,24 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { ConversationColorType, CustomColorType } from '../types/Colors';
|
||||
import type {
|
||||
ConversationColorType,
|
||||
CustomColorType,
|
||||
DefaultConversationColorType,
|
||||
} from '../types/Colors';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
|
||||
export function getConversationColorAttributes(
|
||||
conversationColors: Pick<
|
||||
ConversationType,
|
||||
'conversationColor' | 'customColorId' | 'customColor'
|
||||
>
|
||||
>,
|
||||
defaultConversationColor: DefaultConversationColorType
|
||||
): {
|
||||
conversationColor: ConversationColorType;
|
||||
customColor: CustomColorType | undefined;
|
||||
customColorId: string | undefined;
|
||||
} {
|
||||
const defaultConversationColor = window.Events.getDefaultConversationColor();
|
||||
|
||||
const conversationColor =
|
||||
conversationColors.conversationColor || defaultConversationColor.color;
|
||||
const customColor =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue