From e4057770f4092543da0a53c55a153b330bad28c9 Mon Sep 17 00:00:00 2001 From: malkja Date: Fri, 25 Oct 2024 15:36:19 +0200 Subject: [PATCH 1/5] fix: allocate VariantItems colors after annotations are loaded for each item --- .../annotations/variants/VariantsView.vue | 14 -------------- src/stores/annotations.ts | 4 ++++ src/utils/variants.js | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 src/utils/variants.js diff --git a/src/components/annotations/variants/VariantsView.vue b/src/components/annotations/variants/VariantsView.vue index 5a9f104a..7c67730f 100644 --- a/src/components/annotations/variants/VariantsView.vue +++ b/src/components/annotations/variants/VariantsView.vue @@ -13,8 +13,6 @@ import { getVariantAnnotations } from '@/utils/annotations' const annotationStore = useAnnotationsStore(); const contentsStore = useContentsStore(); -allocateWitnessColorInVariantItem() - const annotations = computed(() => annotationStore.annotations); const activeContentUrl = computed(() => contentsStore.activeContentUrl); @@ -88,18 +86,6 @@ const unsubscribe = TextEventBus.on('click', ({ target }) => { onBeforeUnmount(() => unsubscribe()) - -function allocateWitnessColorInVariantItem() { - const colors = {} - if (!annotationStore.witnesses) return - if (annotationStore.witnesses.length === 0) return; - - annotationStore.witnesses.forEach((witness, i) => { - colors[witness.idno] = getItemColorBasedOnIndex(i) - }) - annotationStore.setVariantItemsColors(colors) - } -