File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
1616 mapToList ,
1717 mapToMap ,
1818 isFalsyString ,
19+ isDefined ,
1920} from '@togglecorp/fujs' ;
2021import { Outlet , useNavigation } from 'react-router-dom' ;
2122
@@ -77,7 +78,17 @@ export function Component() {
7778 onSuccess : ( response , { pages } ) => {
7879 const stringMap = mapToMap (
7980 listToGroupList (
80- response . strings ,
81+ response . strings ?. map ( ( { value, page_name, ...otherArgs } ) => {
82+ // NOTE: removing empty translations or translations without pages
83+ if ( isFalsyString ( value ) || isFalsyString ( page_name ) ) {
84+ return undefined ;
85+ }
86+ return {
87+ value,
88+ page_name,
89+ ...otherArgs ,
90+ } ;
91+ } ) . filter ( isDefined ) ,
8192 ( { page_name } ) => page_name ?? 'common' ,
8293 ) ,
8394 ( key ) => key ,
You can’t perform that action at this time.
0 commit comments