Skip to content

Commit

Permalink
fix: if config doesn't exist, add minimal one with flowLayout (#2793)
Browse files Browse the repository at this point in the history
* fix: if config doesn't exist, add minimal one with flowLayout
  • Loading branch information
tepi authored Oct 4, 2024
1 parent 29cd084 commit 2f3dee9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@ export default async function createViewConfigJson(views: readonly RouteMeta[]):
}
}

if (config === undefined) {
config = { flowLayout: flowLayout ?? false };
}

let title: string;

if (config?.title) {
if (config.title) {
({ title } = config);
} else {
if (!componentName) {
Expand All @@ -91,7 +95,7 @@ export default async function createViewConfigJson(views: readonly RouteMeta[]):
return {
route: convertFSRouteSegmentToURLPatternFormat(path),
...config,
params: extractParameterFromRouteSegment(config?.route ?? path),
params: extractParameterFromRouteSegment(config.route ?? path),
title,
children: newChildren ?? (layout ? [] : undefined),
} satisfies ServerViewConfig;
Expand Down

0 comments on commit 2f3dee9

Please sign in to comment.