Fixes global chat color setting
This commit is contained in:
parent
a6ce00ff37
commit
bd46e3afd6
14 changed files with 250 additions and 122 deletions
|
@ -7,6 +7,11 @@ import { ITEM_NAME as UNIVERSAL_EXPIRE_TIMER_ITEM } from '../../util/universalEx
|
|||
|
||||
import { StateType } from '../reducer';
|
||||
import { ItemsStateType } from '../ducks/items';
|
||||
import {
|
||||
ConversationColors,
|
||||
ConversationColorType,
|
||||
CustomColorType,
|
||||
} from '../../types/Colors';
|
||||
|
||||
export const getItems = (state: StateType): ItemsStateType => state.items;
|
||||
|
||||
|
@ -25,3 +30,16 @@ export const getUniversalExpireTimer = createSelector(
|
|||
getItems,
|
||||
(state: ItemsStateType): number => state[UNIVERSAL_EXPIRE_TIMER_ITEM] || 0
|
||||
);
|
||||
|
||||
export const getDefaultConversationColor = createSelector(
|
||||
getItems,
|
||||
(
|
||||
state: ItemsStateType
|
||||
): {
|
||||
color: ConversationColorType;
|
||||
customColorData?: {
|
||||
id: string;
|
||||
value: CustomColorType;
|
||||
};
|
||||
} => state.defaultConversationColor ?? { color: ConversationColors[0] }
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue