From 19ee929d656d098fe447e6d9f4c192a3f74df386 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Mon, 13 Jan 2025 11:17:01 +0000 Subject: [PATCH] Allow currentUserId to be null when calculating user colour (#22830) GitOrigin-RevId: 70ef0c5a7319fa952690b5e23fae7aef9703eed9 --- services/web/frontend/js/shared/utils/colors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/frontend/js/shared/utils/colors.ts b/services/web/frontend/js/shared/utils/colors.ts index 615dc546c6..27fb1c9203 100644 --- a/services/web/frontend/js/shared/utils/colors.ts +++ b/services/web/frontend/js/shared/utils/colors.ts @@ -5,7 +5,7 @@ const OWN_HUE = 200 // We will always appear as this color to ourselves const OWN_HUE_BLOCKED_SIZE = 20 // no other user should have a HUE in this range const TOTAL_HUES = 360 // actually 361, but 360 for legacy reasons -export function getHueForUserId(userId: string, currentUserId: string) { +export function getHueForUserId(userId: string, currentUserId: string | null) { if (userId == null || userId === 'anonymous-user') { return ANONYMOUS_HUE }