Merge pull request #8 from dkhalife/bugfix/handle-notification-target-failure
Bugfix: handle request error when updating notification type
This commit is contained in:
@@ -129,7 +129,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: {
|
||||
@@ -137,6 +141,7 @@ const NotificationSetting = () => {
|
||||
type: Number(notificationTarget),
|
||||
},
|
||||
})
|
||||
alert('Notification target updated')
|
||||
})
|
||||
}
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user