Skip to content

Commit fe3816f

Browse files
authored
[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
1 parent 2c6eb7d commit fe3816f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

governance/xc-admin/packages/xc-admin-frontend/components/tabs/UpdatePermissions.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ const UpdatePermissions = () => {
139139
pubkey: securityAuthority,
140140
},
141141
])
142+
} else {
143+
setData([...DEFAULT_DATA])
142144
}
143145
}, [rawConfig])
144146

@@ -228,6 +230,12 @@ const UpdatePermissions = () => {
228230
new: newPubkey,
229231
},
230232
})
233+
} else {
234+
// delete account from pubkeyChanges if it exists
235+
if (pubkeyChanges && pubkeyChanges[account]) {
236+
delete pubkeyChanges[account]
237+
}
238+
setPubkeyChanges(pubkeyChanges)
231239
}
232240
}
233241

0 commit comments

Comments
 (0)