on signup/register, set last_profile_update_timestamp to now()

This commit is contained in:
Audric Ackermann 2021-02-26 16:14:13 +11:00
parent b6ff4dc186
commit 0a539c79ce
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
4 changed files with 25 additions and 5 deletions

View File

@ -36,6 +36,17 @@
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() {
const numberId = textsecure.storage.get('number_id');
if (numberId === undefined) {

View File

@ -106,7 +106,7 @@ export async function signUp(signUpDetails: {
await window
.getAccountManager()
.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');
} catch (e) {
ToastUtils.pushToastError(

View File

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

View File

@ -105,3 +105,13 @@ export function getOurProfile(): OurLokiProfile | 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
);
}