@tanstack/router-core 1.134.13 → 1.134.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -271,7 +271,18 @@ class RouterCore {
271
271
  match._nonReactive.pendingTimeout = void 0;
272
272
  };
273
273
  this.cancelMatches = () => {
274
- this.state.pendingMatches?.forEach((match) => {
274
+ const currentPendingMatches = this.state.matches.filter(
275
+ (match) => match.status === "pending"
276
+ );
277
+ const currentLoadingMatches = this.state.matches.filter(
278
+ (match) => match.isFetching === "loader"
279
+ );
280
+ const matchesToCancelArray = /* @__PURE__ */ new Set([
281
+ ...this.state.pendingMatches ?? [],
282
+ ...currentPendingMatches,
283
+ ...currentLoadingMatches
284
+ ]);
285
+ matchesToCancelArray.forEach((match) => {
275
286
  this.cancelMatch(match.id);
276
287
  });
277
288
  };