Skip to content

Commit

Permalink
actually use the created visit in getFragmentVisit
Browse files Browse the repository at this point in the history
  • Loading branch information
hirasso committed Jun 1, 2024
1 parent fd0b344 commit 44fbd08
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/SwupFragmentPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ export default class SwupFragmentPlugin extends PluginBase {
* @access public
*/
getFragmentVisit(route: Route, visit?: Visit): FragmentVisit | undefined {
// @ts-expect-error createVisit is protected
visit = visit || this.swup.createVisit(route);
const rule = getFirstMatchingRule(route, this.parsedRules, visit || this.swup.visit);
const rule = getFirstMatchingRule(
route,
this.parsedRules,
// @ts-expect-error createVisit is protected
visit || this.swup.createVisit(route)
);

// Bail early if no rule matched
if (!rule) return;
Expand Down

0 comments on commit 44fbd08

Please sign in to comment.