add error handling for notification setting update
This commit is contained in:
parent
577791b4ad
commit
562f5f66fe
1 changed files with 6 additions and 1 deletions
|
@ -45,7 +45,11 @@ const NotificationSetting = () => {
|
|||
target: chatID,
|
||||
type: Number(notificationTarget),
|
||||
}).then(resp => {
|
||||
alert('Notification target updated')
|
||||
if (resp.status != 200) {
|
||||
alert(`Error while updating notification target: ${resp.statusText}`)
|
||||
return
|
||||
}
|
||||
|
||||
setUserProfile({
|
||||
...userProfile,
|
||||
notification_target: {
|
||||
|
@ -53,6 +57,7 @@ const NotificationSetting = () => {
|
|||
type: Number(notificationTarget),
|
||||
},
|
||||
})
|
||||
alert('Notification target updated')
|
||||
})
|
||||
}
|
||||
return (
|
||||
|
|
Loading…
Add table
Reference in a new issue