[xc-admin] frontend update permissions bugfix (#528)

* fix bug where setting new pubkey and reverting the change doesnt reflect properly

* fix bug where switching to cluster with permissionAccount and switching back doesnt show default value

* remove console.log
This commit is contained in:
Daniel Chew 2023-01-25 14:14:53 +09:00 committed by GitHub
parent 2c6eb7d1e3
commit fe3816f69a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -139,6 +139,8 @@ const UpdatePermissions = () => {
pubkey: securityAuthority,
},
])
} else {
setData([...DEFAULT_DATA])
}
}, [rawConfig])
@ -228,6 +230,12 @@ const UpdatePermissions = () => {
new: newPubkey,
},
})
} else {
// delete account from pubkeyChanges if it exists
if (pubkeyChanges && pubkeyChanges[account]) {
delete pubkeyChanges[account]
}
setPubkeyChanges(pubkeyChanges)
}
}