Skip to content

Commit 1585647

Browse files
author
Daniel Keller
committed
default license update
1 parent 7ba5656 commit 1585647

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/features/contribute/morphology/_components/components.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export function JSONMorphologySchemaForm({
421421
fetchMtypes(session.accessToken),
422422
]);
423423

424-
let fetchedBrainRegionName = null; // Renamed to avoid shadowing
424+
let fetchedBrainRegionName = null;
425425
if (nodeId) {
426426
fetchedBrainRegionName = await fetchBrainRegion(session.accessToken, nodeId);
427427
}
@@ -441,6 +441,10 @@ export function JSONMorphologySchemaForm({
441441
}
442442
if (licensesData) {
443443
setAllLicenses(licensesData);
444+
if (!state.license_id) {
445+
const defaultLicenseId = 'ad8686db-3cdd-4e3f-bcbd-812380a9eba7';
446+
setState((prev) => ({ ...prev, license_id: defaultLicenseId }));
447+
}
444448
}
445449
if (mtypesData) {
446450
setAllMtypes(mtypesData);
@@ -449,7 +453,7 @@ export function JSONMorphologySchemaForm({
449453
};
450454

451455
fetchData();
452-
}, [nodeId]);
456+
}, [nodeId, state.license_id, setState]);
453457

454458
const markFieldTouched = (field: string) => {
455459
setTouchedFields((prev) => new Set([...prev, field]));

0 commit comments

Comments
 (0)