Skip to content

Commit

Permalink
Merge pull request #1022 from AI4Bharat/lsf-language-bug
Browse files Browse the repository at this point in the history
Lsf language bug
  • Loading branch information
ishvindersethi22 authored May 6, 2024
2 parents fdca950 + dc1fc24 commit be97be6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/ui/pages/container/Label-Studio/LSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -990,14 +990,18 @@ const LabelStudioWrapper = ({
if(taskData){
if(Array.isArray(taskData?.data?.language)){
taskData?.data?.language?.map((lang)=>{
selectedLanguages.current?.push(lang);
if (!selectedLanguages.current.includes(lang)) {
selectedLanguages.current.push(lang);
}
const newLanguages = new Set([...selectedL, ...taskData?.data?.language]);
setSelectedL(Array.from(newLanguages));
});
}
if(typeof taskData?.data?.language === 'string' && taskData?.data?.ocr_domain !== ""){
setSelectedL([taskData?.data?.language]);
selectedLanguages.current?.push(taskData?.data?.language);
if (!selectedLanguages.current.includes(taskData?.data?.language)) {
selectedLanguages.current.push(taskData?.data?.language);
}
}
if(typeof taskData?.data?.ocr_domain === 'string' && taskData?.data?.ocr_domain !== ""){
ocrDomain.current = taskData?.data?.ocr_domain;
Expand Down
8 changes: 6 additions & 2 deletions src/ui/pages/container/Label-Studio/ReviewLSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1198,14 +1198,18 @@ useEffect(() => {
if(taskData){
if(Array.isArray(taskData?.data?.language)){
taskData?.data?.language?.map((lang)=>{
selectedLanguages.current?.push(lang);
if (!selectedLanguages.current.includes(lang)) {
selectedLanguages.current.push(lang);
}
const newLanguages = new Set([...selectedL, ...taskData?.data?.language]);
setSelectedL(Array.from(newLanguages));
});
}
if(typeof taskData?.data?.language === 'string' && taskData?.data?.ocr_domain !== ""){
setSelectedL([taskData?.data?.language]);
selectedLanguages.current?.push(taskData?.data?.language);
if (!selectedLanguages.current.includes(taskData?.data?.language)) {
selectedLanguages.current.push(taskData?.data?.language);
}
}
if(typeof taskData?.data?.ocr_domain === 'string' && taskData?.data?.ocr_domain !== ""){
ocrDomain.current = taskData?.data?.ocr_domain;
Expand Down
8 changes: 6 additions & 2 deletions src/ui/pages/container/Label-Studio/SuperCheckerLSF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -910,14 +910,18 @@ useEffect(() => {
if(taskData){
if(Array.isArray(taskData?.data?.language)){
taskData?.data?.language?.map((lang)=>{
selectedLanguages.current?.push(lang);
if (!selectedLanguages.current.includes(lang)) {
selectedLanguages.current.push(lang);
}
const newLanguages = new Set([...selectedL, ...taskData?.data?.language]);
setSelectedL(Array.from(newLanguages));
});
}
if(typeof taskData?.data?.language === 'string' && taskData?.data?.ocr_domain !== ""){
setSelectedL([taskData?.data?.language]);
selectedLanguages.current?.push(taskData?.data?.language);
if (!selectedLanguages.current.includes(taskData?.data?.language)) {
selectedLanguages.current.push(taskData?.data?.language);
}
}
if(typeof taskData?.data?.ocr_domain === 'string' && taskData?.data?.ocr_domain !== ""){
ocrDomain.current = taskData?.data?.ocr_domain;
Expand Down

0 comments on commit be97be6

Please sign in to comment.