on signup/register, set last_profile_update_timestamp to now()

pull/1528/head
Audric Ackermann 4 years ago
parent b6ff4dc186
commit 0a539c79ce
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -36,6 +36,17 @@
textsecure.storage.put('is_restoring_from_seed', isRestoringFromSeed); textsecure.storage.put('is_restoring_from_seed', isRestoringFromSeed);
}, },
getLastProfileUpdateTimestamp() {
return textsecure.storage.get('last_profile_update_timestamp');
},
setLastProfileUpdateTimestamp(lastUpdateTimestamp) {
textsecure.storage.put(
'last_profile_update_timestamp',
lastUpdateTimestamp
);
},
getDeviceId() { getDeviceId() {
const numberId = textsecure.storage.get('number_id'); const numberId = textsecure.storage.get('number_id');
if (numberId === undefined) { if (numberId === undefined) {

@ -106,7 +106,7 @@ export async function signUp(signUpDetails: {
await window await window
.getAccountManager() .getAccountManager()
.registerSingleDevice(generatedRecoveryPhrase, 'english', trimName); .registerSingleDevice(generatedRecoveryPhrase, 'english', trimName);
// We are just creating a new account, no need to wait for a configuration message await UserUtils.setLastProfileUpdateTimestamp(Date.now());
trigger('openInbox'); trigger('openInbox');
} catch (e) { } catch (e) {
ToastUtils.pushToastError( ToastUtils.pushToastError(

@ -13,10 +13,10 @@ export enum SignInMode {
UsingRecoveryPhrase, UsingRecoveryPhrase,
LinkDevice, LinkDevice,
} }
// tslint:disable: use-simple-attributes
// tslint:disable: react-unused-props-and-state
export interface Props { export interface Props {}
// tslint:disable: react-unused-props-and-state
}
const LinkDeviceButton = (props: { onLinkDeviceButtonClicked: () => any }) => { const LinkDeviceButton = (props: { onLinkDeviceButtonClicked: () => any }) => {
return ( return (
@ -99,7 +99,6 @@ export const SignInTab = (props: Props) => {
return ( return (
<div className="session-registration__content"> <div className="session-registration__content">
{signInMode !== SignInMode.Default && ( {signInMode !== SignInMode.Default && (
// tslint:disable: use-simple-attributes
<RegistrationUserDetails <RegistrationUserDetails
showDisplayNameField={signInMode === SignInMode.UsingRecoveryPhrase} showDisplayNameField={signInMode === SignInMode.UsingRecoveryPhrase}
showSeedField={true} showSeedField={true}

@ -105,3 +105,13 @@ export function getOurProfile(): OurLokiProfile | undefined {
return undefined; return undefined;
} }
} }
export function getLastProfileUpdateTimestamp(): number | undefined {
return window.textsecure.storage.user.getLastProfileUpdateTimestamp();
}
export function setLastProfileUpdateTimestamp(lastUpdateTimestamp: number) {
return window.textsecure.storage.user.setLastProfileUpdateTimestamp(
lastUpdateTimestamp
);
}

Loading…
Cancel
Save