Repository navigation
Commit 6e3064f
refactor(mobile): the share inbox is a module store, presented from navigation state
The incoming share inbox lived in a React provider that wrapped the
navigation container: four effects loaded it, subscribed to app resume,
tracked mount state, and turned an error state into an alert. A fifth
effect in the root stack layout re-ran on every navigation state change to
decide whether to open the pending share.
The inbox is now a module store. App.tsx starts it once at module scope
(with the fast-refresh disposer, like the other app services); it loads
persisted shares, re-ingests native handoffs on every resume through the
new subscribeAppActive helper, and alerts directly when an import fails.
Screens read it with useSyncExternalStore through the same useIncomingShare
hook. presentPendingIncomingShare runs when the inbox publishes and from
the container's onReady/onStateChange, with the same presentation state
machine and route params as before. <IncomingShareProvider> is gone.
Effects: IncomingShareProvider.tsx 4 -> 0, Stack.tsx 1 -> 0, App.tsx 0 -> 0.
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent d145077 commit 6e3064f
4 files changed
Lines changed: 129 additions & 192 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| |||
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | 142 | | |
148 | 143 | | |
149 | 144 | | |
150 | 145 | | |
151 | 146 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 147 | + | |
156 | 148 | | |
157 | 149 | | |
158 | 150 | | |
| |||
498 | 490 | | |
499 | 491 | | |
500 | 492 | | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | 493 | | |
505 | 494 | | |
506 | 495 | | |
| |||
519 | 508 | | |
520 | 509 | | |
521 | 510 | | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | 511 | | |
539 | 512 | | |
540 | 513 | | |
| |||
0 commit comments