fix: Adjust error message formatting for better readability in multiple components
This commit is contained in:
@@ -106,7 +106,8 @@ const LoginSettings = () => {
|
||||
if (!isValidServerURL()) {
|
||||
showError({
|
||||
title: 'Invalid Server URL',
|
||||
message: 'Please enter a valid server URL with protocol (http:// or https://)',
|
||||
message:
|
||||
'Please enter a valid server URL with protocol (http:// or https://)',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -397,7 +397,8 @@ const LoginView = () => {
|
||||
onReject={() => {
|
||||
showError({
|
||||
title: 'Google Login Failed',
|
||||
message: "Couldn't log in with Google, please try again",
|
||||
message:
|
||||
"Couldn't log in with Google, please try again",
|
||||
})
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -104,14 +104,14 @@ const SignupView = () => {
|
||||
} else if (response.status === 403) {
|
||||
showError({
|
||||
title: 'Signup Failed',
|
||||
message: 'Signup disabled, please contact admin'
|
||||
message: 'Signup disabled, please contact admin',
|
||||
})
|
||||
} else {
|
||||
console.log('Signup failed')
|
||||
response.json().then(res => {
|
||||
showError({
|
||||
title: 'Signup Failed',
|
||||
message: res.error || 'An error occurred during signup'
|
||||
message: res.error || 'An error occurred during signup',
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
RadioGroup,
|
||||
Select,
|
||||
Sheet,
|
||||
Stack,
|
||||
Switch,
|
||||
Typography,
|
||||
} from '@mui/joy'
|
||||
|
||||
@@ -315,7 +315,8 @@ const MyChores = () => {
|
||||
case 'archive':
|
||||
showSuccess({
|
||||
title: 'Task Archived',
|
||||
message: 'The task has been archived and hidden from the active list.',
|
||||
message:
|
||||
'The task has been archived and hidden from the active list.',
|
||||
})
|
||||
break
|
||||
default:
|
||||
|
||||
@@ -147,7 +147,8 @@ const NotificationSetting = () => {
|
||||
} else if (resp.display === 'denied') {
|
||||
showWarning({
|
||||
title: 'Notification Permission Denied',
|
||||
message: 'You have denied notification permissions. You can enable them later in your device settings.',
|
||||
message:
|
||||
'You have denied notification permissions. You can enable them later in your device settings.',
|
||||
})
|
||||
setDeviceNotification(false)
|
||||
setNotificationPreferences({ granted: false })
|
||||
|
||||
@@ -104,7 +104,8 @@ const ProfileSettings = () => {
|
||||
} catch (err) {
|
||||
showError({
|
||||
title: 'Update Failed',
|
||||
message: 'Unable to update your profile. Please check your connection and try again.',
|
||||
message:
|
||||
'Unable to update your profile. Please check your connection and try again.',
|
||||
})
|
||||
} finally {
|
||||
setIsSaving(false)
|
||||
|
||||
Reference in New Issue
Block a user