Skip to content

Commit 82b692b

Browse files
authored
Merge pull request #234 from software-mansion-labs/add_log_to_patch
add log
2 parents 6d18198 + 9c2d425 commit 82b692b

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

patches/@react-navigation+native+7.1.10+001+initial.patch

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
diff --git a/node_modules/@react-navigation/native/lib/module/createMemoryHistory.js b/node_modules/@react-navigation/native/lib/module/createMemoryHistory.js
2-
index 474db5e..b3167bc 100644
2+
index 474db5e..4d94ed8 100644
33
--- a/node_modules/@react-navigation/native/lib/module/createMemoryHistory.js
44
+++ b/node_modules/@react-navigation/native/lib/module/createMemoryHistory.js
5-
@@ -1,6 +1,7 @@
5+
@@ -1,10 +1,27 @@
66
"use strict";
77

88
import { nanoid } from 'nanoid/non-secure';
99
+import { findFocusedRouteKey } from "./findFocusedRouteKey.js";
1010
export function createMemoryHistory() {
1111
let index = 0;
1212
let items = [];
13-
@@ -17,7 +18,10 @@ export function createMemoryHistory() {
13+
14+
+ // const log = () => {
15+
+ // console.log(JSON.stringify({
16+
+ // index,
17+
+ // indexGetter: history.index,
18+
+ // items: items.map((item, i) => {
19+
+ // var _item$state;
20+
+ // return {
21+
+ // selected: history.index === i ? '<<<<<<<' : undefined,
22+
+ // path: item.path,
23+
+ // id: item.id,
24+
+ // state: ((_item$state = item.state) === null || _item$state === void 0 ? void 0 : _item$state.key) || null
25+
+ // };
26+
+ // })
27+
+ // }, null, 4));
28+
+ // };
29+
+
30+
// Pending callbacks for `history.go(n)`
31+
// We might modify the callback stored if it was interrupted, so we have a ref to identify it
32+
const pending = [];
33+
@@ -17,7 +34,10 @@ export function createMemoryHistory() {
1434
it.cb = () => cb(true);
1535
});
1636
};
@@ -22,7 +42,7 @@ index 474db5e..b3167bc 100644
2242
get index() {
2343
// We store an id in the state instead of an index
2444
// Index could get out of sync with in-memory values if page reloads
25-
@@ -32,12 +36,13 @@ export function createMemoryHistory() {
45+
@@ -32,12 +52,13 @@ export function createMemoryHistory() {
2646
return items[index];
2747
},
2848
backIndex({
@@ -38,7 +58,7 @@ index 474db5e..b3167bc 100644
3858
return i;
3959
}
4060
}
41-
@@ -77,7 +82,7 @@ export function createMemoryHistory() {
61+
@@ -77,7 +98,7 @@ export function createMemoryHistory() {
4262

4363
// Need to keep the hash part of the path if there was no previous history entry
4464
// or the previous history entry had the same path
@@ -47,14 +67,13 @@ index 474db5e..b3167bc 100644
4767
const hash = pathWithHash.includes('#') ? '' : location.hash;
4868
if (!items.length || items.findIndex(item => item.id === id) < 0) {
4969
// There are two scenarios for creating an array with only one history record:
50-
@@ -211,6 +216,5 @@ export function createMemoryHistory() {
70+
@@ -211,6 +232,5 @@ export function createMemoryHistory() {
5171
return () => window.removeEventListener('popstate', onPopState);
5272
}
5373
};
5474
- return history;
5575
}
5676
//# sourceMappingURL=createMemoryHistory.js.map
57-
\ No newline at end of file
5877
diff --git a/node_modules/@react-navigation/native/lib/module/findFocusedRouteKey.js b/node_modules/@react-navigation/native/lib/module/findFocusedRouteKey.js
5978
new file mode 100644
6079
index 0000000..b996822

0 commit comments

Comments
 (0)