diff --git a/app/mobile/src/context/useAppContext.hook.js b/app/mobile/src/context/useAppContext.hook.js index 1b2dd8b8..029d1b19 100644 --- a/app/mobile/src/context/useAppContext.hook.js +++ b/app/mobile/src/context/useAppContext.hook.js @@ -78,7 +78,9 @@ export function useAppContext() { { event: 'contact.addCard', messageTitle: 'New Contact Request' }, { event: 'contact.updateCard', messageTitle: 'Contact Update' }, { event: 'content.addChannel.superbasic', messageTitle: 'New Topic' }, + { event: 'content.addChannel.sealed', messageTitle: 'New Topic' }, { event: 'content.addChannelTopic.superbasic', messageTitle: 'New Topic Message' }, + { event: 'content.addChannelTopic.sealedtopic', messageTitle: 'New Topic Message' }, ]; const actions = { diff --git a/app/mobile/src/session/profile/profileBody/ProfileBody.jsx b/app/mobile/src/session/profile/profileBody/ProfileBody.jsx index a91f198a..2a2d45bb 100644 --- a/app/mobile/src/session/profile/profileBody/ProfileBody.jsx +++ b/app/mobile/src/session/profile/profileBody/ProfileBody.jsx @@ -380,11 +380,16 @@ export function ProfileBody({ navigation }) { { state.canSaveSeal && ( <> - { state.sealMode !== 'unlocking' && ( + { state.sealMode !== 'unlocking' && state.sealMode !== 'unlocked' && ( Save )} + { state.sealMode === 'unlocked' && ( + + Forget + + )} { state.sealMode === 'unlocking' && ( Unlock diff --git a/app/mobile/src/session/profile/profileBody/useProfileBody.hook.js b/app/mobile/src/session/profile/profileBody/useProfileBody.hook.js index 32639bf2..4144e72e 100644 --- a/app/mobile/src/session/profile/profileBody/useProfileBody.hook.js +++ b/app/mobile/src/session/profile/profileBody/useProfileBody.hook.js @@ -175,6 +175,10 @@ export function useProfileBody() { await account.actions.unlockAccountSeal(sealKey); }; + const sealForget = async () => { + await account.actions.unlockAccountSeal({}); + } + const sealUpdate = async () => { // generate key to encrypt private key const salt = CryptoJS.lib.WordArray.random(128 / 8); @@ -199,6 +203,9 @@ export function useProfileBody() { }; useEffect(() => { + if (state.sealMode === 'unlocked') { + return updateState({ canSaveSeal: true }); + } if (state.sealMode === 'unlocking' && state.sealUnlock != null && state.sealUnlock !== '') { return updateState({ canSaveSeal: true }); } @@ -265,6 +272,9 @@ export function useProfileBody() { else if (state.sealMode === 'unlocking') { await sealUnlock(); } + else if (state.sealMode === 'unlocked') { + await sealForget(); + } else if (state.sealMode === 'updating') { await sealUpdate(); }