Skip to content

Commit d966c3e

Browse files
priscilawebdevandrewshie-sentry
authored andcommitted
feat: Keep tab category by unselecting platform (#96058)
follow-up of #95856 (comment). It seems that my commit reverting the last feedback was not pushed.
1 parent 8e05eb6 commit d966c3e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

static/app/components/modals/projectCreationModal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default function ProjectCreationModal({
4242
closeModal,
4343
defaultCategory,
4444
}: Props) {
45+
const [category, setCategory] = useState<Category | undefined>(defaultCategory);
4546
const [platform, setPlatform] = useState<OnboardingSelectedSDK | undefined>(undefined);
4647
const [step, setStep] = useState(0);
4748
const [projectName, setProjectName] = useState('');
@@ -61,6 +62,7 @@ export default function ProjectCreationModal({
6162
...omit(selectedPlatform, 'id'),
6263
key: selectedPlatform.id,
6364
});
65+
setCategory(selectedPlatform.category);
6466
}
6567

6668
const createProject = useCallback(async () => {
@@ -136,7 +138,7 @@ export default function ProjectCreationModal({
136138
<Fragment>
137139
<Subtitle>{t('Choose a Platform')}</Subtitle>
138140
<PlatformPicker
139-
defaultCategory={platform?.category ?? defaultCategory}
141+
defaultCategory={category}
140142
setPlatform={handlePlatformChange}
141143
organization={organization}
142144
platform={platform?.key}

0 commit comments

Comments
 (0)