Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-torabiv committed Dec 5, 2024
1 parent 574c9b1 commit 1160143
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const App: React.FC = () => {
status={authStatus}
>
<RainbowKitProvider
initialChain={chainId ?? isProduction ? arbitrum : baseSepolia}
initialChain={chainId ?? (isProduction ? arbitrum : baseSepolia)}
theme={lightTheme({
accentColor: '#4200FF',
})}
Expand Down
13 changes: 8 additions & 5 deletions src/services/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ apiInstance.interceptors.response.use(
});
window.location.href = '/auth/login';
} else if (error.response?.status === 400) {
showSnackbar(`${error.response.data.message.message[0]}`, {
severity: 'warning',
duration: 5000,
position: { vertical: 'bottom', horizontal: 'right' },
});
showSnackbar(
`${error.response?.data?.message?.message?.[0] || 'Bad request'}`,
{
severity: 'warning',
duration: 5000,
position: { vertical: 'bottom', horizontal: 'right' },
}
);
window.location.href = '/auth/login';
} else {
showSnackbar('An unexpected error occurred.', {
Expand Down

0 comments on commit 1160143

Please sign in to comment.