From 0186f93c99c3a59078625952c183fe20f11943f5 Mon Sep 17 00:00:00 2001 From: vmonakhov Date: Sun, 29 Sep 2024 17:29:53 +0300 Subject: [PATCH] getting language id --- src/components/CognateAnalysisModal/index.js | 6 ++++-- src/pages/DistanceMap/getDistancePerspectives.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/CognateAnalysisModal/index.js b/src/components/CognateAnalysisModal/index.js index f1156677..d4bb9b37 100644 --- a/src/components/CognateAnalysisModal/index.js +++ b/src/components/CognateAnalysisModal/index.js @@ -2122,11 +2122,12 @@ class CognateAnalysisModal extends React.Component { for (const language of this.state.language_list) { let p_count = 0; - for (const { perspective } of language.perspective_list) { + for (const { perspective, treePathList: [language,,] } of language.perspective_list) { const p_key = id2str(perspective.id); if (this.state.perspectiveSelectionMap[p_key]) { perspectiveInfoList.push([ + language.id, perspective.id, this.fieldDict[this.state.transcriptionFieldIdStrMap[p_key]].id, this.fieldDict[this.state.translationFieldIdStrMap[p_key]].id, @@ -2142,7 +2143,8 @@ class CognateAnalysisModal extends React.Component { } else { perspectiveInfoList = this.perspective_list - .map(({ perspective }, index) => [ + .map(({ perspective, treePathList: [language,,] }, index) => [ + language.id, perspective.id, this.fieldDict[this.state.transcriptionFieldIdStrList[index]].id, this.fieldDict[this.state.translationFieldIdStrList[index]].id, diff --git a/src/pages/DistanceMap/getDistancePerspectives.js b/src/pages/DistanceMap/getDistancePerspectives.js index 3e9f343d..d6efdf4a 100644 --- a/src/pages/DistanceMap/getDistancePerspectives.js +++ b/src/pages/DistanceMap/getDistancePerspectives.js @@ -100,6 +100,7 @@ const getDistance = async (dictionaries, allField, mainDictionary, computeDistan const perspectiveInfoList = perspectiveList .map(({ perspective }, index) => [ + null, perspective.id, fieldDict[transcriptionFieldIdStrList[index]].id, fieldDict[translationFieldIdStrList[index]].id,