New User Onboarding Task List (#9083)

* Improve type of AccessibleButton to accurately represent available props
* Update analytics events
This commit is contained in:
Janne Mareike Koschinski 2022-07-29 13:43:29 +02:00 committed by GitHub
parent 45f6c32eb6
commit 1e4c336fed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 1261 additions and 22 deletions

View file

@ -98,6 +98,12 @@ export interface IMatrixClientPeg {
*/
userRegisteredWithinLastHours(hours: number): boolean;
/**
* If the current user has been registered by this device then this
* returns a boolean of whether it was after a given timestamp.
*/
userRegisteredAfter(date: Date): boolean;
/**
* Replace this MatrixClientPeg's client with a client instance that has
* homeserver / identity server URLs and active credentials
@ -168,6 +174,15 @@ class MatrixClientPegClass implements IMatrixClientPeg {
}
}
public userRegisteredAfter(timestamp: Date): boolean {
try {
const registrationTime = parseInt(window.localStorage.getItem("mx_registration_time"), 10);
return timestamp.getTime() <= registrationTime;
} catch (e) {
return false;
}
}
public replaceUsingCreds(creds: IMatrixClientCreds): void {
this.currentClientCreds = creds;
this.createClient(creds);