Merge branch 'notification-bug' of WrenchBoard/Users-Wrench into master
This commit is contained in:
@@ -26,7 +26,7 @@ export default function NotificationSettingTab() {
|
|||||||
setAccSettings(prev => {
|
setAccSettings(prev => {
|
||||||
let newAccSettings = prev.data.map(data => {
|
let newAccSettings = prev.data.map(data => {
|
||||||
if(data.uid == item.uid){
|
if(data.uid == item.uid){
|
||||||
let newPrefValue = data.pref_value == null || data.pref_value == false ? true : false
|
let newPrefValue = data.pref_value == null || data.pref_value == '0' ? '100' : '0'
|
||||||
return {...data, pref_value: newPrefValue}
|
return {...data, pref_value: newPrefValue}
|
||||||
}else{
|
}else{
|
||||||
return data
|
return data
|
||||||
@@ -40,7 +40,7 @@ export default function NotificationSettingTab() {
|
|||||||
setNotificationChange({loading: true, uid: item.uid})
|
setNotificationChange({loading: true, uid: item.uid})
|
||||||
let reqData = { // API PAYLOADS
|
let reqData = { // API PAYLOADS
|
||||||
pref_id: item.pref_id,
|
pref_id: item.pref_id,
|
||||||
status: '100'
|
status: item.pref_value == null || item.pref_value == 0 ? 100 : 0
|
||||||
}
|
}
|
||||||
api.setAccSettings(reqData).then(res => {
|
api.setAccSettings(reqData).then(res => {
|
||||||
if(res.status != 200 || res.data.internal_return < 0){
|
if(res.status != 200 || res.data.internal_return < 0){
|
||||||
@@ -94,7 +94,7 @@ export default function NotificationSettingTab() {
|
|||||||
<LoadingSpinner size='8' color='sky-blue' />
|
<LoadingSpinner size='8' color='sky-blue' />
|
||||||
:
|
:
|
||||||
<SwitchCom
|
<SwitchCom
|
||||||
value={item.pref_value}
|
value={item.pref_value == null || item.pref_value == '0' ? 0 : 100}
|
||||||
handler={ notificationChange.loading ? ()=>{} : () => handleNotificationChange(item)}
|
handler={ notificationChange.loading ? ()=>{} : () => handleNotificationChange(item)}
|
||||||
// value={updateNotification}
|
// value={updateNotification}
|
||||||
// handler={() => setUpdateNotification(!updateNotification)}
|
// handler={() => setUpdateNotification(!updateNotification)}
|
||||||
|
|||||||
Reference in New Issue
Block a user