mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29: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>
|
<EditFooter>
|
||||||
<div class="select"></div>
|
<div class="select"></div>
|
||||||
<Button key="back" onClick={actions.clearEditSeal}>Cancel</Button>
|
<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' && (
|
{ state.sealMode === 'unlocking' && (
|
||||||
<Button key="save" type="primary" onClick={saveSeal} disabled={!actions.canSaveSeal()} loading={state.busy}>Unlock</Button>
|
<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>
|
<Button key="save" type="primary" onClick={saveSeal} disabled={!actions.canSaveSeal()} loading={state.busy}>Save</Button>
|
||||||
)}
|
)}
|
||||||
</EditFooter>
|
</EditFooter>
|
||||||
|
@ -99,6 +99,10 @@ export function useAccountAccess() {
|
|||||||
await account.actions.unlockSeal(sealKey);
|
await account.actions.unlockSeal(sealKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sealForget = async () => {
|
||||||
|
await account.actions.unlockSeal({});
|
||||||
|
};
|
||||||
|
|
||||||
const sealEnable = async () => {
|
const sealEnable = async () => {
|
||||||
|
|
||||||
// generate key to encrypt private key
|
// generate key to encrypt private key
|
||||||
@ -268,6 +272,9 @@ export function useAccountAccess() {
|
|||||||
else if (state.sealMode === 'unlocking') {
|
else if (state.sealMode === 'unlocking') {
|
||||||
await sealUnlock();
|
await sealUnlock();
|
||||||
}
|
}
|
||||||
|
else if (state.sealMode === 'enabled') {
|
||||||
|
await sealForget();
|
||||||
|
}
|
||||||
updateState({ busy: false });
|
updateState({ busy: false });
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user