diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -70,6 +70,7 @@ } from '../types/user-types'; import { useDispatchActionPromise, useServerCall } from '../utils/action-utils'; import type { DispatchActionPromise } from '../utils/action-utils'; +import { values } from '../utils/objects'; import { useSelector } from '../utils/redux-utils'; import { firstLine } from '../utils/string-utils'; import { pluralize, trimText } from '../utils/text-utils'; @@ -82,23 +83,24 @@ return tinycolor(`#${color}`).isDark(); } -const selectedThreadColorsObj = { - '4B87AA': 1, - '5C9F5F': 2, - 'B8753D': 3, - 'AA4B4B': 4, - '6D49AB': 5, - 'C85000': 6, - '008F83': 7, - '648CAA': 8, - '57697F': 9, - '575757': 10, -}; - -const selectedThreadColors: $ReadOnlyArray = Object.keys( +const selectedThreadColorsObj = Object.freeze({ + a: '4B87AA', + b: '5C9F5F', + c: 'B8753D', + d: 'AA4B4B', + e: '6D49AB', + f: 'C85000', + g: '008F83', + h: '648CAA', + i: '57697F', + j: '575757', +}); + +const selectedThreadColors: $ReadOnlyArray = values( selectedThreadColorsObj, ); -export type SelectedThreadColors = $Keys; + +export type SelectedThreadColors = $Values; function generateRandomColor(): string { return selectedThreadColors[