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);
|
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() {
|
getLastProfileUpdateTimestamp() {
|
||||||
return textsecure.storage.get('last_profile_update_timestamp');
|
return textsecure.storage.get('last_profile_update_timestamp');
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { recoveryPhraseModal } from '../../state/ducks/modalDialog';
|
||||||
import { Flex } from '../basic/Flex';
|
import { Flex } from '../basic/Flex';
|
||||||
import { getFocusedSection } from '../../state/selectors/section';
|
import { getFocusedSection } from '../../state/selectors/section';
|
||||||
import { SectionType } from '../../state/ducks/section';
|
import { SectionType } from '../../state/ducks/section';
|
||||||
|
import { UserUtils } from '../../session/utils';
|
||||||
|
|
||||||
const Tab = ({
|
const Tab = ({
|
||||||
isSelected,
|
isSelected,
|
||||||
|
@ -86,8 +87,9 @@ const BannerInner = () => {
|
||||||
|
|
||||||
export const LeftPaneBanner = () => {
|
export const LeftPaneBanner = () => {
|
||||||
const section = useSelector(getFocusedSection);
|
const section = useSelector(getFocusedSection);
|
||||||
|
const isSignInWithRecoveryPhrase = UserUtils.isSignWithRecoveryPhrase();
|
||||||
|
|
||||||
if (section !== SectionType.Message) {
|
if (section !== SectionType.Message || isSignInWithRecoveryPhrase) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ export async function signUp(signUpDetails: {
|
||||||
id: 'hasSyncedInitialConfigurationItem',
|
id: 'hasSyncedInitialConfigurationItem',
|
||||||
value: true,
|
value: true,
|
||||||
});
|
});
|
||||||
|
UserUtils.setSignWithRecoveryPhrase(false);
|
||||||
trigger('openInbox');
|
trigger('openInbox');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await resetRegistration();
|
await resetRegistration();
|
||||||
|
@ -93,6 +94,8 @@ export async function signInWithRecovery(signInDetails: {
|
||||||
await resetRegistration();
|
await resetRegistration();
|
||||||
|
|
||||||
await registerSingleDevice(userRecoveryPhrase, 'english', trimName);
|
await registerSingleDevice(userRecoveryPhrase, 'english', trimName);
|
||||||
|
UserUtils.setSignWithRecoveryPhrase(true);
|
||||||
|
|
||||||
trigger('openInbox');
|
trigger('openInbox');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await resetRegistration();
|
await resetRegistration();
|
||||||
|
@ -119,6 +122,7 @@ export async function signInWithLinking(signInDetails: { userRecoveryPhrase: str
|
||||||
window.Whisper.events.on('configurationMessageReceived', (displayName: string) => {
|
window.Whisper.events.on('configurationMessageReceived', (displayName: string) => {
|
||||||
window.Whisper.events.off('configurationMessageReceived');
|
window.Whisper.events.off('configurationMessageReceived');
|
||||||
UserUtils.setSignInByLinking(false);
|
UserUtils.setSignInByLinking(false);
|
||||||
|
UserUtils.setSignWithRecoveryPhrase(true);
|
||||||
done(displayName);
|
done(displayName);
|
||||||
|
|
||||||
displayNameFromNetwork = displayName;
|
displayNameFromNetwork = displayName;
|
||||||
|
|
|
@ -85,6 +85,14 @@ export function setSignInByLinking(isLinking: boolean) {
|
||||||
window.textsecure.storage.user.setSignInByLinking(isLinking);
|
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 {
|
export interface OurLokiProfile {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
avatarPointer: string;
|
avatarPointer: string;
|
||||||
|
|
Loading…
Reference in New Issue