Username onboarding

This commit is contained in:
Fedor Indutny 2023-02-13 10:51:41 -08:00 committed by GitHub
parent 5626cea9c3
commit f9aaf30a32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 309 additions and 3 deletions

View file

@ -395,6 +395,14 @@ export function toAccountRecord(
accountRecord.hasViewedOnboardingStory = hasViewedOnboardingStory;
}
const hasCompletedUsernameOnboarding = window.storage.get(
'hasCompletedUsernameOnboarding'
);
if (hasCompletedUsernameOnboarding !== undefined) {
accountRecord.hasCompletedUsernameOnboarding =
hasCompletedUsernameOnboarding;
}
const hasStoriesDisabled = window.storage.get('hasStoriesDisabled');
accountRecord.storiesDisabled = hasStoriesDisabled === true;
@ -1137,6 +1145,7 @@ export async function mergeAccountRecord(
subscriberCurrencyCode,
displayBadgesOnProfile,
keepMutedChatsArchived,
hasCompletedUsernameOnboarding,
hasSetMyStoriesPrivacy,
hasViewedOnboardingStory,
storiesDisabled,
@ -1368,6 +1377,15 @@ export async function mergeAccountRecord(
void findAndDeleteOnboardingStoryIfExists();
}
}
{
const hasCompletedUsernameOnboardingBool = Boolean(
hasCompletedUsernameOnboarding
);
await window.storage.put(
'hasCompletedUsernameOnboarding',
hasCompletedUsernameOnboardingBool
);
}
{
const hasStoriesDisabled = Boolean(storiesDisabled);
await window.storage.put('hasStoriesDisabled', hasStoriesDisabled);