@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.
- package/native/index.js +13 -1
- 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
|
-
|
|
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) {
|