Skip to content

Commit 44fbd08

Browse files
committed
actually use the created visit in getFragmentVisit
1 parent fd0b344 commit 44fbd08

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/SwupFragmentPlugin.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,12 @@ export default class SwupFragmentPlugin extends PluginBase {
142142
* @access public
143143
*/
144144
getFragmentVisit(route: Route, visit?: Visit): FragmentVisit | undefined {
145-
// @ts-expect-error createVisit is protected
146-
visit = visit || this.swup.createVisit(route);
147-
const rule = getFirstMatchingRule(route, this.parsedRules, visit || this.swup.visit);
145+
const rule = getFirstMatchingRule(
146+
route,
147+
this.parsedRules,
148+
// @ts-expect-error createVisit is protected
149+
visit || this.swup.createVisit(route)
150+
);
148151

149152
// Bail early if no rule matched
150153
if (!rule) return;

0 commit comments

Comments
 (0)