Skip to content

Commit

Permalink
Set default resume in case of failure and re-render
Browse files Browse the repository at this point in the history
  • Loading branch information
Babasile committed Dec 4, 2021
1 parent f934fe3 commit bb9daa9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/single-page/single-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {Resume} from "../../interfaces/Resume.interface";
function SinglePage() {
const { t, i18n } = useTranslation();
let locale;
let init;
let init: Resume;
if( i18n.language.toLowerCase().startsWith( "fr" ) ) {
locale = "fr-FR";
init = new DataFr();
Expand All @@ -45,6 +45,8 @@ function SinglePage() {
setIsLoading(false);
}
if (error && !data) {
setResume(init)
setNavLinks(createNavLinks(init));
setIsLoading(false);
}
}, [loading, error, data]);
Expand Down

0 comments on commit bb9daa9

Please sign in to comment.