Skip to content

Commit a40b18c

Browse files
committed
fix: unit routes
1 parent 9c46a2a commit a40b18c

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/library-authoring/containers/UnitInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const UnitInfo = () => {
8484
>
8585
{renderTab(UNIT_INFO_TABS.Preview, <LibraryUnitBlocks />, intl.formatMessage(messages.previewTabTitle))}
8686
{renderTab(UNIT_INFO_TABS.Organize, <ContainerOrganize />, intl.formatMessage(messages.organizeTabTitle))}
87-
{renderTab(UNIT_INFO_TABS.Settings, "Unit Settings", intl.formatMessage(messages.settingsTabTitle))}
87+
{renderTab(UNIT_INFO_TABS.Settings, 'Unit Settings', intl.formatMessage(messages.settingsTabTitle))}
8888
</Tabs>
8989
</Stack>
9090
);

src/library-authoring/routes.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,14 @@ export const useLibraryRoutes = (): LibraryRoutesData => {
124124
// optionally selecting a component.
125125
route = ROUTES.COMPONENTS;
126126
} else if (insideUnits) {
127-
// We're inside the Units tab, so stay there,
128-
// optionally selecting a unit.
129-
route = ROUTES.UNITS;
127+
// We're inside the units tab,
128+
route = (
129+
(unitId && unitId === (urlUnitId || urlSelectedItemId))
130+
// now open the previously-selected unit,
131+
? ROUTES.UNIT
132+
// or stay there to list all units, or a selected unit.
133+
: ROUTES.UNITS
134+
);
130135
} else if (insideUnit) {
131136
// We're viewing a Unit, so stay there,
132137
// and optionally select a component in that Unit.

0 commit comments

Comments
 (0)