Merge pull request #8 from dkhalife/bugfix/handle-notification-target-failure
Bugfix: handle request error when updating notification type
This commit is contained in:
commit
1d0f9ed1ed
1 changed files with 6 additions and 1 deletions
|
@ -129,7 +129,11 @@ const NotificationSetting = () => {
|
||||||
target: chatID,
|
target: chatID,
|
||||||
type: Number(notificationTarget),
|
type: Number(notificationTarget),
|
||||||
}).then(resp => {
|
}).then(resp => {
|
||||||
alert('Notification target updated')
|
if (resp.status != 200) {
|
||||||
|
alert(`Error while updating notification target: ${resp.statusText}`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
setUserProfile({
|
setUserProfile({
|
||||||
...userProfile,
|
...userProfile,
|
||||||
notification_target: {
|
notification_target: {
|
||||||
|
@ -137,6 +141,7 @@ const NotificationSetting = () => {
|
||||||
type: Number(notificationTarget),
|
type: Number(notificationTarget),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
alert('Notification target updated')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Reference in a new issue