Skip to content

Commit

Permalink
Revert "Use default highlight colors in cache init if sync settings e…
Browse files Browse the repository at this point in the history
…mpty"

This reverts commit 395bff4.
  • Loading branch information
blackforestboi committed Jun 14, 2024
1 parent 00174f9 commit aaaa35d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/annotations/cache/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import type { BackgroundModuleRemoteInterfaces } from 'src/background-script/typ
import type { SharedListMetadata } from 'src/content-sharing/background/types'
import { DEFAULT_KEY } from '@worldbrain/memex-common/lib/utils/item-ordering'
import { createSyncSettingsStore } from 'src/sync-settings/util'
import { HIGHLIGHT_COLORS_DEFAULT } from '@worldbrain/memex-common/lib/common-ui/components/highlightColorPicker/constants'

export const reshapeAnnotationForCache = (
annot: Annotation & {
Expand Down Expand Up @@ -260,9 +259,9 @@ export async function hydrateCacheForPageAnnotations(
const syncSettingsStore = createSyncSettingsStore({
syncSettingsBG: args.bgModules.syncSettings,
})
const highlightColors =
(await syncSettingsStore.highlightColors.get('highlightColors')) ??
HIGHLIGHT_COLORS_DEFAULT
const highlightColors = await syncSettingsStore.highlightColors.get(
'highlightColors',
)
args.cache.setHighlightColorDictionary(highlightColors)

args.cache.setAnnotations(
Expand Down

0 comments on commit aaaa35d

Please sign in to comment.