do not display the reveal seed banner if user just used it
This commit is contained in:
parent
390af96514
commit
25910be0fd
|
@ -36,6 +36,17 @@
|
|||
textsecure.storage.put('is_sign_in_by_linking', isLinking);
|
||||
},
|
||||
|
||||
isSignWithRecoveryPhrase() {
|
||||
const isRecoveryPhraseUsed = textsecure.storage.get('is_sign_in_recovery_phrase');
|
||||
if (isRecoveryPhraseUsed === undefined) {
|
||||
return false;
|
||||
}
|
||||
return isRecoveryPhraseUsed;
|
||||
},
|
||||
setSignWithRecoveryPhrase(isRecoveryPhraseUsed) {
|
||||
textsecure.storage.put('is_sign_in_recovery_phrase', isRecoveryPhraseUsed);
|
||||
},
|
||||
|
||||
getLastProfileUpdateTimestamp() {
|
||||
return textsecure.storage.get('last_profile_update_timestamp');
|
||||
},
|
||||
|
|
|
@ -10,6 +10,7 @@ import { recoveryPhraseModal } from '../../state/ducks/modalDialog';
|
|||
import { Flex } from '../basic/Flex';
|
||||
import { getFocusedSection } from '../../state/selectors/section';
|
||||
import { SectionType } from '../../state/ducks/section';
|
||||
import { UserUtils } from '../../session/utils';
|
||||
|
||||
const Tab = ({
|
||||
isSelected,
|
||||
|
@ -86,8 +87,9 @@ const BannerInner = () => {
|
|||
|
||||
export const LeftPaneBanner = () => {
|
||||
const section = useSelector(getFocusedSection);
|
||||
const isSignInWithRecoveryPhrase = UserUtils.isSignWithRecoveryPhrase();
|
||||
|
||||
if (section !== SectionType.Message) {
|
||||
if (section !== SectionType.Message || isSignInWithRecoveryPhrase) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ export async function signUp(signUpDetails: {
|
|||
id: 'hasSyncedInitialConfigurationItem',
|
||||
value: true,
|
||||
});
|
||||
UserUtils.setSignWithRecoveryPhrase(false);
|
||||
trigger('openInbox');
|
||||
} catch (e) {
|
||||
await resetRegistration();
|
||||
|
@ -93,6 +94,8 @@ export async function signInWithRecovery(signInDetails: {
|
|||
await resetRegistration();
|
||||
|
||||
await registerSingleDevice(userRecoveryPhrase, 'english', trimName);
|
||||
UserUtils.setSignWithRecoveryPhrase(true);
|
||||
|
||||
trigger('openInbox');
|
||||
} catch (e) {
|
||||
await resetRegistration();
|
||||
|
@ -119,6 +122,7 @@ export async function signInWithLinking(signInDetails: { userRecoveryPhrase: str
|
|||
window.Whisper.events.on('configurationMessageReceived', (displayName: string) => {
|
||||
window.Whisper.events.off('configurationMessageReceived');
|
||||
UserUtils.setSignInByLinking(false);
|
||||
UserUtils.setSignWithRecoveryPhrase(true);
|
||||
done(displayName);
|
||||
|
||||
displayNameFromNetwork = displayName;
|
||||
|
|
|
@ -85,6 +85,14 @@ export function setSignInByLinking(isLinking: boolean) {
|
|||
window.textsecure.storage.user.setSignInByLinking(isLinking);
|
||||
}
|
||||
|
||||
export function isSignWithRecoveryPhrase(): boolean {
|
||||
return window.textsecure.storage.user.isSignWithRecoveryPhrase();
|
||||
}
|
||||
|
||||
export function setSignWithRecoveryPhrase(isLinking: boolean) {
|
||||
window.textsecure.storage.user.setSignWithRecoveryPhrase(isLinking);
|
||||
}
|
||||
|
||||
export interface OurLokiProfile {
|
||||
displayName: string;
|
||||
avatarPointer: string;
|
||||
|
|
Loading…
Reference in New Issue