Skip to content

Commit

Permalink
Merge pull request #988 from UNICEFECAR/fixImportIssue-208952
Browse files Browse the repository at this point in the history
Update the SettingScreen.tsx file
  • Loading branch information
deepakmali-dgsl authored Jul 31, 2024
2 parents 34572c0 + 7a12828 commit 72470e4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/screens/home/SettingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,15 @@ const SettingScreen = (props: any): any => {
const countryId = useAppSelector(
(state: any) => state.selectedCountry?.countryId,
);
const allCountries = useAppSelector(
(state: any) =>
state.selectedCountry.countries != '' ? JSON.parse(state.selectedCountry.countries) : [],
);
const allCountries = useAppSelector(
(state: any) => {
try {
return state.selectedCountry?.countries !== '' ? JSON.parse(state.selectedCountry?.countries) : [];
} catch (error) {
console.error('Failed to parse countries JSON:', error);
return [];
}
});
const [profileLoading, setProfileLoading] = React.useState(false);
const languageCode = useAppSelector(
(state: any) => state.selectedCountry?.languageCode,
Expand Down Expand Up @@ -1254,4 +1259,4 @@ const SettingScreen = (props: any): any => {
);
};

export default SettingScreen;
export default SettingScreen;

0 comments on commit 72470e4

Please sign in to comment.