Skip to content

Commit

Permalink
fix: Ensure header always has flow slug breadcrumb on settings pages
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Sep 27, 2024
1 parent 191c5b3 commit 399b2d7
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions editor.planx.uk/src/routes/team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ let cached: { flowSlug?: string; teamSlug?: string } = {
};

const setFlowAndLazyLoad = (importComponent: Parameters<typeof lazy>[0]) => {
return map(async (request) => {
const data = await getFlowEditorData(request.params.flow, request.params.team);
useStore.setState({ ...data, flowSlug: request.params.flow });

return lazy(importComponent);
});
return compose(
withData((req) => ({
flow: req.params.flow.split(",")[0],
})),

map(async (request) => {
const data = await getFlowEditorData(
request.params.flow,
request.params.team,
);
useStore.setState({ ...data, flowSlug: request.params.flow });

return lazy(importComponent);
}),
);
};

const routes = compose(
Expand Down

0 comments on commit 399b2d7

Please sign in to comment.