Skip to content

Commit

Permalink
fix with equations not appearing (#4990)
Browse files Browse the repository at this point in the history
  • Loading branch information
asylves1 committed Sep 30, 2024
1 parent 15e658a commit b17c4c6
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ import TeraDrilldownPreview from '@/components/drilldown/tera-drilldown-preview.
import TeraAssetBlock from '@/components/widgets/tera-asset-block.vue';
import { computed, onMounted, ref, watch } from 'vue';
import { downloadDocumentAsset, getDocumentAsset, getDocumentFileAsText } from '@/services/document-assets';
import type { Card, DocumentAsset, DocumentExtraction, Model } from '@/types/Types';
import type { Card, DocumentAsset, Model } from '@/types/Types';
import { cloneDeep, isEmpty } from 'lodash';
import { equationsToAMR, type EquationsToAMRRequest } from '@/services/knowledge';
import Button from 'primevue/button';
Expand Down Expand Up @@ -248,7 +248,6 @@ onMounted(async () => {
}
const documentId = props.node.inputs?.[0]?.value?.[0]?.documentId;
const equations: AssetBlock<DocumentExtraction>[] = props.node.inputs?.[0]?.value?.[0]?.equations;
assetLoading.value = true;
if (documentId) {
Expand Down Expand Up @@ -284,19 +283,18 @@ onMounted(async () => {
);
}
if (documentEquations.value && documentEquations.value?.length > 0) {
clonedState.value.equations = documentEquations.value;
}
clonedState.value.equations = documentEquations.value.map((e, index) => ({
name: `${e.name} ${index}`,
includeInProcess: e.includeInProcess,
asset: { text: e.asset.text }
}));
state.equations = equations.map((e, index) => ({
name: `${e.name} ${index}`,
includeInProcess: e.includeInProcess,
asset: { text: e.asset.metadata.text }
}));
state.equations = clonedState.value.equations;
}
state.text = document.value?.text ?? '';
emit('update-state', state);
}
assetLoading.value = false;
});
Expand Down

0 comments on commit b17c4c6

Please sign in to comment.