From a0d4b1493a9d1b24f7bedc25cc7fec2fe0f236e2 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 20 Dec 2022 17:20:57 +0800 Subject: [PATCH] Simplify code to set custom highlight color --- .../web/lib/highlights/highlightGenerator.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/web/lib/highlights/highlightGenerator.ts b/packages/web/lib/highlights/highlightGenerator.ts index 09806c835..40f6d7046 100644 --- a/packages/web/lib/highlights/highlightGenerator.ts +++ b/packages/web/lib/highlights/highlightGenerator.ts @@ -67,20 +67,10 @@ function nodeAttributesFromHighlight( const patch = highlight.patch const id = highlight.id const withNote = !!highlight.annotation - let customColor = undefined const tooltip = undefined - // We've disabled shared highlights, so passing undefined - // here now, and removing the user object from highlights - // !highlight.createdByMe - // ? stringToColour(highlight.user.profile.username) - // : undefined - // const tooltip = !highlight.createdByMe - // ? `Created by: @${highlight.user.profile.username}` - // : undefined - - if (!highlight.createdByMe) { - customColor = 'var(--colors-recommendedHighlightBackground)' - } + const customColor = highlight.createdByMe + ? undefined + : 'var(--colors-recommendedHighlightBackground)' return makeHighlightNodeAttributes(patch, id, withNote, customColor, tooltip) }