mirror of
https://github.com/balzack/databag.git
synced 2025-02-11 19:19:16 +00:00
adding forget key option to webapp
This commit is contained in:
parent
b0c97b86f5
commit
c0942cb4ab
@ -61,10 +61,13 @@ export function AccountAccess() {
|
||||
<EditFooter>
|
||||
<div class="select"></div>
|
||||
<Button key="back" onClick={actions.clearEditSeal}>Cancel</Button>
|
||||
{ state.sealMode === 'enabled' && (
|
||||
<Button key="save" type="primary" onClick={saveSeal} loading={state.busy}>Forget</Button>
|
||||
)}
|
||||
{ state.sealMode === 'unlocking' && (
|
||||
<Button key="save" type="primary" onClick={saveSeal} disabled={!actions.canSaveSeal()} loading={state.busy}>Unlock</Button>
|
||||
)}
|
||||
{ state.sealMode !== 'unlocking' && (
|
||||
{ state.sealMode !== 'unlocking' && state.sealMode !== 'enabled' && (
|
||||
<Button key="save" type="primary" onClick={saveSeal} disabled={!actions.canSaveSeal()} loading={state.busy}>Save</Button>
|
||||
)}
|
||||
</EditFooter>
|
||||
|
@ -99,6 +99,10 @@ export function useAccountAccess() {
|
||||
await account.actions.unlockSeal(sealKey);
|
||||
};
|
||||
|
||||
const sealForget = async () => {
|
||||
await account.actions.unlockSeal({});
|
||||
};
|
||||
|
||||
const sealEnable = async () => {
|
||||
|
||||
// generate key to encrypt private key
|
||||
@ -268,6 +272,9 @@ export function useAccountAccess() {
|
||||
else if (state.sealMode === 'unlocking') {
|
||||
await sealUnlock();
|
||||
}
|
||||
else if (state.sealMode === 'enabled') {
|
||||
await sealForget();
|
||||
}
|
||||
updateState({ busy: false });
|
||||
}
|
||||
catch (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user