@resistdesign/voltra 3.0.0-alpha.19 → 3.0.0-alpha.20
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 +6 -2
- package/native/utils/History.d.ts +4 -1
- package/package.json +1 -1
package/native/index.js
CHANGED
|
@@ -1185,11 +1185,15 @@ var createNativeHistory = (options = {}) => {
|
|
|
1185
1185
|
if (!adapter) {
|
|
1186
1186
|
return;
|
|
1187
1187
|
}
|
|
1188
|
-
const
|
|
1189
|
-
|
|
1188
|
+
const startKey = history.location.key;
|
|
1189
|
+
const startIndex = history.index;
|
|
1190
1190
|
unsubscribe = adapter.subscribe((url) => {
|
|
1191
1191
|
applyIncomingURL(url);
|
|
1192
1192
|
});
|
|
1193
|
+
const initialURL = await adapter.getInitialURL();
|
|
1194
|
+
if (history.location.key === startKey && history.index === startIndex) {
|
|
1195
|
+
applyIncomingURL(initialURL);
|
|
1196
|
+
}
|
|
1193
1197
|
},
|
|
1194
1198
|
stop: () => {
|
|
1195
1199
|
if (!started) {
|
|
@@ -75,7 +75,10 @@ export declare const mapNativeURLToPath: (url: string) => string;
|
|
|
75
75
|
* Lifecycle behavior:
|
|
76
76
|
* - `start()` is idempotent.
|
|
77
77
|
* - `stop()` is idempotent.
|
|
78
|
-
* - `start()` applies `getInitialURL()` once per start cycle
|
|
78
|
+
* - `start()` applies `getInitialURL()` once per start cycle only if
|
|
79
|
+
* navigation state has not changed since startup began.
|
|
80
|
+
* - This prevents late `getInitialURL()` resolution from overriding
|
|
81
|
+
* user navigation that happened during startup.
|
|
79
82
|
*
|
|
80
83
|
* Incoming URL behavior:
|
|
81
84
|
* - `"replace"` updates current entry (default).
|