Skip to content

Commit 2323ca4

Browse files
authored
refactor(console): update profile fulfill dropdown icon and improve options parser (#7666)
1 parent 9c83550 commit 2323ca4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
Lines changed: 1 addition & 2 deletions
Loading

packages/console/src/pages/SignInExperience/PageContent/CollectUserProfile/data-parser.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ const parseOptionsArrayToString = (
2929

3030
const parseOptionsStringToArray = (
3131
options?: string
32-
): Optional<Array<{ value: string; label: string }>> =>
32+
): Optional<Array<{ value: string; label?: string }>> =>
3333
options
3434
?.split('\n')
3535
.map((option) => {
36-
const [value = '', label = value] = option.split(':');
36+
const [value, label] = option.split(':');
37+
if (!value) {
38+
return;
39+
}
3740
return { value, label };
3841
})
39-
.filter(Boolean);
42+
.filter((option) => option !== undefined);
4043

4144
const getDefaultOptions = (name: string) => {
4245
if (name === 'gender') {

0 commit comments

Comments
 (0)