Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3357178
D3715.id11491.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3715.id11491.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D3715: [web] Modify `selectedThreadColors` to preserve order of keys
Attached
Detach File
Event Timeline
Log In to Comment