on signup/register, set last_profile_update_timestamp to now()
This commit is contained in:
parent
b6ff4dc186
commit
0a539c79ce
|
@ -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) {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue