@resistdesign/voltra 3.0.0-alpha.20 → 3.0.0-alpha.21

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.
Files changed (2) hide show
  1. package/native/index.js +13 -1
  2. package/package.json +1 -1
package/native/index.js CHANGED
@@ -1188,7 +1188,19 @@ var createNativeHistory = (options = {}) => {
1188
1188
  const startKey = history.location.key;
1189
1189
  const startIndex = history.index;
1190
1190
  unsubscribe = adapter.subscribe((url) => {
1191
- applyIncomingURL(url);
1191
+ const targetPath = mapURLToPath(url);
1192
+ if (!targetPath) {
1193
+ return;
1194
+ }
1195
+ const userNavigated = history.location.key !== startKey || history.index !== startIndex;
1196
+ if (userNavigated && targetPath === initialPath) {
1197
+ return;
1198
+ }
1199
+ if (onIncomingURL === "push") {
1200
+ history.push(targetPath, { replaceSearch: true });
1201
+ } else {
1202
+ history.replace(targetPath, { replaceSearch: true });
1203
+ }
1192
1204
  });
1193
1205
  const initialURL = await adapter.getInitialURL();
1194
1206
  if (history.location.key === startKey && history.index === startIndex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resistdesign/voltra",
3
- "version": "3.0.0-alpha.20",
3
+ "version": "3.0.0-alpha.21",
4
4
  "description": "With our powers combined!",
5
5
  "homepage": "https://voltra.app",
6
6
  "repository": "git@github.com:resistdesign/voltra.git",