Skip to content

Commit 91277f1

Browse files
author
anakin_karrot
committed
reformat
1 parent 0ef2009 commit 91277f1

File tree

1 file changed

+69
-71
lines changed

1 file changed

+69
-71
lines changed

extensions/plugin-history-sync/src/historySyncPlugin.tsx

Lines changed: 69 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -261,82 +261,80 @@ export function historySyncPlugin<
261261

262262
if (options.skipDefaultHistorySetupTransition) {
263263
initialSetupProcess = new SerialNavigationProcess([
264-
() => {
265-
const events: (
266-
| Omit<PushedEvent, "eventDate">
267-
| Omit<StepPushedEvent, "eventDate">
268-
)[] = [
269-
...defaultHistory.flatMap(
270-
({ activityName, activityParams, additionalSteps = [] }) => {
271-
const activityId = id();
272-
273-
activityActivationMonitors.push(
274-
new DefaultHistoryActivityActivationMonitor(
275-
activityId,
276-
initialSetupProcess!,
277-
),
278-
);
279-
280-
const events: (
281-
| Omit<PushedEvent, "eventDate">
282-
| Omit<StepPushedEvent, "eventDate">
283-
)[] = [
284-
{
285-
name: "Pushed",
286-
id: id(),
287-
activityId,
288-
activityName,
289-
activityParams: {
290-
...activityParams,
291-
},
292-
activityContext: {
293-
path: currentPath,
294-
lazyActivityComponentRenderContext: {
295-
shouldRenderImmediately: true,
296-
},
264+
(): (
265+
| Omit<PushedEvent, "eventDate">
266+
| Omit<StepPushedEvent, "eventDate">
267+
)[] => [
268+
...defaultHistory.flatMap(
269+
({
270+
activityName,
271+
activityParams,
272+
additionalSteps = [],
273+
}): (
274+
| Omit<PushedEvent, "eventDate">
275+
| Omit<StepPushedEvent, "eventDate">
276+
)[] => {
277+
const activityId = id();
278+
279+
activityActivationMonitors.push(
280+
new DefaultHistoryActivityActivationMonitor(
281+
activityId,
282+
initialSetupProcess!,
283+
),
284+
);
285+
286+
return [
287+
{
288+
name: "Pushed",
289+
id: id(),
290+
activityId,
291+
activityName,
292+
activityParams: {
293+
...activityParams,
294+
},
295+
activityContext: {
296+
path: currentPath,
297+
lazyActivityComponentRenderContext: {
298+
shouldRenderImmediately: true,
297299
},
298-
skipEnterActiveState: true,
299300
},
300-
...additionalSteps.map(
301-
({
302-
stepParams,
303-
hasZIndex,
304-
}): Omit<StepPushedEvent, "eventDate"> => ({
305-
name: "StepPushed",
306-
id: id(),
307-
stepId: id(),
308-
stepParams,
309-
hasZIndex,
310-
}),
311-
),
312-
];
313-
314-
return events;
315-
},
316-
),
317-
{
318-
name: "Pushed",
319-
id: id(),
320-
activityId: id(),
321-
activityName: targetActivityRoute.activityName,
322-
activityParams:
323-
makeTemplate(
324-
targetActivityRoute,
325-
options.urlPatternOptions,
326-
).parse(currentPath) ??
327-
urlSearchParamsToMap(pathToUrl(currentPath).searchParams),
328-
activityContext: {
329-
path: currentPath,
330-
lazyActivityComponentRenderContext: {
331-
shouldRenderImmediately: true,
301+
skipEnterActiveState: true,
332302
},
303+
...additionalSteps.map(
304+
({
305+
stepParams,
306+
hasZIndex,
307+
}): Omit<StepPushedEvent, "eventDate"> => ({
308+
name: "StepPushed",
309+
id: id(),
310+
stepId: id(),
311+
stepParams,
312+
hasZIndex,
313+
}),
314+
),
315+
];
316+
},
317+
),
318+
{
319+
name: "Pushed",
320+
id: id(),
321+
activityId: id(),
322+
activityName: targetActivityRoute.activityName,
323+
activityParams:
324+
makeTemplate(
325+
targetActivityRoute,
326+
options.urlPatternOptions,
327+
).parse(currentPath) ??
328+
urlSearchParamsToMap(pathToUrl(currentPath).searchParams),
329+
activityContext: {
330+
path: currentPath,
331+
lazyActivityComponentRenderContext: {
332+
shouldRenderImmediately: true,
333333
},
334-
skipEnterActiveState: true,
335334
},
336-
];
337-
338-
return events;
339-
},
335+
skipEnterActiveState: true,
336+
},
337+
],
340338
]);
341339
} else {
342340
initialSetupProcess = new SerialNavigationProcess([

0 commit comments

Comments
 (0)