+
+
+
{i18n(`icu:${CLASS}__title`)}
+
+
+
+
+
+ {i18n(`icu:${CLASS}__row__number`)}
+
+
+
+
+
+
+
+ {i18n(`icu:${CLASS}__row__link`)}
+
+
+
+
+
+
+
+ {i18n(`icu:${CLASS}__row__lock`)}
+
+
+
+
+
+
+
+ );
+}
diff --git a/ts/services/storageRecordOps.ts b/ts/services/storageRecordOps.ts
index 2b6f2af631be..17206cb3a841 100644
--- a/ts/services/storageRecordOps.ts
+++ b/ts/services/storageRecordOps.ts
@@ -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);
diff --git a/ts/state/selectors/items.ts b/ts/state/selectors/items.ts
index 56578922faa3..453b7095c3d7 100644
--- a/ts/state/selectors/items.ts
+++ b/ts/state/selectors/items.ts
@@ -74,6 +74,12 @@ export const getUsernamesEnabled = createSelector(
isRemoteConfigFlagEnabled(remoteConfig, 'desktop.usernames')
);
+export const getHasCompletedUsernameOnboarding = createSelector(
+ getItems,
+ (state: ItemsStateType): boolean =>
+ Boolean(state.hasCompletedUsernameOnboarding)
+);
+
export const isInternalUser = createSelector(
getRemoteConfig,
(remoteConfig: ConfigMapType): boolean => {
diff --git a/ts/state/smart/ProfileEditorModal.tsx b/ts/state/smart/ProfileEditorModal.tsx
index e260dd4ac63e..ed832c655f9b 100644
--- a/ts/state/smart/ProfileEditorModal.tsx
+++ b/ts/state/smart/ProfileEditorModal.tsx
@@ -8,10 +8,15 @@ import { mapDispatchToProps } from '../actions';
import type { PropsDataType as ProfileEditorModalPropsType } from '../../components/ProfileEditorModal';
import { ProfileEditorModal } from '../../components/ProfileEditorModal';
import type { PropsDataType } from '../../components/ProfileEditor';
+import { storageServiceUploadJob } from '../../services/storage';
import { SmartEditUsernameModalBody } from './EditUsernameModalBody';
import type { StateType } from '../reducer';
import { getIntl } from '../selectors/user';
-import { getEmojiSkinTone, getUsernamesEnabled } from '../selectors/items';
+import {
+ getEmojiSkinTone,
+ getUsernamesEnabled,
+ getHasCompletedUsernameOnboarding,
+} from '../selectors/items';
import { getMe } from '../selectors/conversations';
import { selectRecentEmojis } from '../selectors/emojis';
import { getUsernameEditState } from '../selectors/username';
@@ -22,6 +27,12 @@ function renderEditUsernameModalBody(props: {
return