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

@ -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 =