diff --git a/src/pages/ListCognates/index.js b/src/pages/ListCognates/index.js index 432e20bf..545d0d66 100644 --- a/src/pages/ListCognates/index.js +++ b/src/pages/ListCognates/index.js @@ -62,6 +62,8 @@ const ListCognates = connect(state => state.user)(({user}) => { ); } + const fail = !data || !data.cognates_summary.triumph; + return (
{(user.id === undefined) && !loading ? ( @@ -82,7 +84,7 @@ const ListCognates = connect(state => state.user)(({user}) => { checked={shownParentGroup} onChange={(e, { checked }) => { showParentGroup(checked); - setCleanResult(!data); + setCleanResult(fail); }} />

@@ -94,7 +96,7 @@ const ListCognates = connect(state => state.user)(({user}) => { placeholder={getTranslation("Set group name or leave empty")} onChange={(e, { value }) => { setLanguageGroup(value); - setCleanResult(!data); + setCleanResult(fail); }} //className="lingvo-labeled-input" style={{ width: 500, maxWidth: "80%" }} @@ -108,7 +110,7 @@ const ListCognates = connect(state => state.user)(({user}) => { placeholder={getTranslation("Set title or leave empty")} onChange={(e, { value }) => { setLanguageTitle(value); - setCleanResult(!data); + setCleanResult(fail); }} //className="lingvo-labeled-input" style={{ width: 500, maxWidth: "80%" }} @@ -119,7 +121,7 @@ const ListCognates = connect(state => state.user)(({user}) => { checked={shownLanguagePosition} onChange={(e, { checked }) => { showLanguagePosition(checked); - setCleanResult(!data); + setCleanResult(fail); }} />

@@ -130,7 +132,7 @@ const ListCognates = connect(state => state.user)(({user}) => { checked={onlyInToc} onChange={(e, { checked }) => { setOnlyInToc(checked); - setCleanResult(!data); + setCleanResult(fail); }} />

@@ -141,7 +143,7 @@ const ListCognates = connect(state => state.user)(({user}) => { value={perspectiveOffset} onChange={(e, { value }) => { setPerspectiveOffset(value); - setCleanResult(!data); + setCleanResult(fail); }} //className="lingvo-labeled-input" style={{ width: 80, maxWidth: "40%" }} @@ -154,7 +156,7 @@ const ListCognates = connect(state => state.user)(({user}) => { value={perspectiveLimit} onChange={(e, { value }) => { setPerspectiveLimit(value); - setCleanResult(!data); + setCleanResult(fail); }} //className="lingvo-labeled-input" style={{ width: 80, maxWidth: "40%" }} @@ -183,7 +185,13 @@ const ListCognates = connect(state => state.user)(({user}) => {

{error.message}

)} - { data && !error && !cleanResult && ( + { data && !data.cognates_summary.triumph && !error && !cleanResult && ( + + {getTranslation("Request error")} +

{data.cognates_summary.message}

+
+ )} + { data && data.cognates_summary.triumph && !error && ( {getTranslation("Scanned successfully")}