Skip to content

Commit

Permalink
fix: fixing InterVar display issues after lookup failure (#443) (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Feb 6, 2024
1 parent f25548e commit fec70e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion frontend/src/components/CadaRanking/CadaRanking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const geneRank = computed<GeneRank | null>(() => {
// Function to load the data.
const loadData = async () => {
await caseInfoStore.initialize()
await cadaPrioStore.loadData(caseInfoStore.caseInfo.hpoTerms.map((term) => term.termId))
if ((caseInfoStore.caseInfo.hpoTerms ?? []).length !== 0) {
await cadaPrioStore.loadData(caseInfoStore.caseInfo.hpoTerms.map((term) => term.termId))
}
}
// Load case store when mounted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ const fontColor = computed(() => {
watch(
() => [props.seqvar, acmgRatingStore.storeState],
async () => {
if (
props.seqvar?.genomeBuild === 'grch37' &&
![StoreState.Loading, StoreState.Error].includes(acmgRatingStore.storeState)
) {
if (props.seqvar?.genomeBuild === 'grch37') {
try {
await acmgRatingStore.fetchAcmgRating(props.seqvar)
if (acmgRatingStore.acmgRatingStatus === false) {
Expand All @@ -180,6 +177,8 @@ watch(
errorMessage.value = msg
emit('errorDisplay', msg)
}
} else {
acmgRatingStore.clearData()
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ const calculateAcmgScore = computed((): number => {
watch(
() => [props.strucvar, acmgRatingStore.storeState],
async () => {
if (props.strucvar && acmgRatingStore.storeState === StoreState.Active) {
if (props.strucvar) {
await acmgRatingStore.fetchAcmgRating(props.strucvar)
} else {
acmgRatingStore.clearData()
}
}
)
Expand Down

0 comments on commit fec70e3

Please sign in to comment.