Page MenuHomePhabricator

D3715.id11491.diff
No OneTemporary

D3715.id11491.diff

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,23 @@
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<string> = 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<string> = values(
selectedThreadColorsObj,
);
-export type SelectedThreadColors = $Keys<typeof selectedThreadColorsObj>;
+export type SelectedThreadColors = $Values<typeof selectedThreadColorsObj>;
function generateRandomColor(): string {
return selectedThreadColors[

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 10:43 PM (19 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577121
Default Alt Text
D3715.id11491.diff (1 KB)

Event Timeline