@remix-run/router 1.2.1-pre.0 → 1.2.1

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.2.1-pre.0
2
+ * @remix-run/router v1.2.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1548,17 +1548,14 @@
1548
1548
 
1549
1549
 
1550
1550
  function completeNavigation(location, newState) {
1551
- var _state$navigation$for;
1551
+ var _location$state;
1552
1552
 
1553
1553
  // Deduce if we're in a loading/actionReload state:
1554
1554
  // - We have committed actionData in the store
1555
- // - The current navigation was a submission
1555
+ // - The current navigation was a mutation submission
1556
1556
  // - We're past the submitting state and into the loading state
1557
- // - The location we've finished loading is different from the submission
1558
- // location, indicating we redirected from the action (avoids false
1559
- // positives for loading/submissionRedirect when actionData returned
1560
- // on a prior submission)
1561
- let isActionReload = state.actionData != null && state.navigation.formMethod != null && state.navigation.state === "loading" && ((_state$navigation$for = state.navigation.formAction) == null ? void 0 : _state$navigation$for.split("?")[0]) === location.pathname;
1557
+ // - The location being loaded is not the result of a redirect
1558
+ let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;
1562
1559
  let actionData;
1563
1560
 
1564
1561
  if (newState.actionData) {
@@ -2121,7 +2118,6 @@
2121
2118
  fetchers: new Map(state.fetchers)
2122
2119
  });
2123
2120
  return startRedirectNavigation(state, actionResult, {
2124
- submission,
2125
2121
  isFetchActionRedirect: true
2126
2122
  });
2127
2123
  } // Process any non-redirect errors thrown
@@ -2200,9 +2196,7 @@
2200
2196
  let redirect = findRedirect(results);
2201
2197
 
2202
2198
  if (redirect) {
2203
- return startRedirectNavigation(state, redirect, {
2204
- submission
2205
- });
2199
+ return startRedirectNavigation(state, redirect);
2206
2200
  } // Process and commit output from loaders
2207
2201
 
2208
2202