@@ -14,7 +14,7 @@ import "./styles.scss";
1414const SyncModal = ( { perspectiveId, onClose, silentMode, action, debugFlag } ) => {
1515 const getTranslation = useContext ( TranslationContext ) ;
1616 const [ applied , setApplied ] = useState ( false ) ;
17- const [ message , setMessage ] = useState ( "" ) ;
17+ const [ errorMessage , setErrorMessage ] = useState ( null ) ;
1818
1919 const { data : ispSyncData , error : ispSyncError , loading : ispSyncLoading } = useQuery ( queryListChanges , {
2020 variables : { remote : 'isp' , syncBetween : [ 'isp' , 'xal' ] , perspectiveId, debugFlag } ,
@@ -35,10 +35,10 @@ const SyncModal = ({ perspectiveId, onClose, silentMode, action, debugFlag }) =>
3535 const [ applySync , { data : dataApply , error : errorApply , loading : loadingApply } ] = useMutation (
3636 applySyncMutation , {
3737 variables : { perspectiveId, syncBetween : [ 'isp' , 'xal' ] , action, debugFlag } ,
38- onCompleted : ( { apply_sync : { triumph, message : info } } ) => {
39- if ( info ) {
40- setMessage ( info ) ;
41- console . log ( info ) ;
38+ onCompleted : ( { apply_sync : { triumph, message} } ) => {
39+ if ( message ) {
40+ setErrorMessage ( message ) ;
41+ console . log ( message ) ;
4242 }
4343 setApplied ( triumph ) ;
4444 }
@@ -185,7 +185,7 @@ const SyncModal = ({ perspectiveId, onClose, silentMode, action, debugFlag }) =>
185185 < Message negative >
186186 < Message . Header > { getTranslation ( "Synchronize data loading error" ) } </ Message . Header >
187187 < div style = { { marginTop : "0.25em" } } >
188- { getTranslation ( message ? message :
188+ { getTranslation ( errorMessage ? errorMessage :
189189 "Try reloading the page; if the error persists, please contact administrators." ) }
190190 </ div >
191191 </ Message >
@@ -323,7 +323,8 @@ const SyncModal = ({ perspectiveId, onClose, silentMode, action, debugFlag }) =>
323323 ispSyncError ||
324324 xalSyncError ||
325325 loadingApply ||
326- errorApply
326+ errorApply ||
327+ errorMessage
327328 }
328329 className = "lingvo-button-greenest lingvo-button-greenest_sync"
329330 />
0 commit comments