Skip to content

Commit

Permalink
fix(login-screen): unnecessary unauthorized alert removed
Browse files Browse the repository at this point in the history
  • Loading branch information
EgeOnder authored and lpezzolla committed Feb 26, 2024
1 parent f755d26 commit 7f65090
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/providers/ApiProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@ export const ApiProvider = ({ children }: PropsWithChildren) => {
await client.invalidateQueries();
}
const { message } = await error.response.json();
Alert.alert(t('common.error'), message ?? t('common.somethingWentWrong'));

// The login alert is handled in the login screen
if (!error.response.url.includes('/login'))
Alert.alert(
t('common.error'),
message ?? t('common.somethingWentWrong'),
);

if (!isEnvProduction) {
console.error(message);
console.error(JSON.stringify(error));
Expand Down

0 comments on commit 7f65090

Please sign in to comment.