Commit f0a736f
committed
fix(direct-send): replace lossy SharedFlow resolve event with StateFlow state
The resolve result was emitted via a SharedFlow (replay=0), which could
be missed if the amount entry screen had not subscribed yet -- causing a
spurious contact not on Flipcash error. Move resolve status into a
ResolveState sealed interface on the ViewModel state (StateFlow, always
replays current value). The amount screen now reads resolve state
reactively and handles Pending/Failed/Resolved cases proactively.
Also embeds the DeviceContact in ResolveState to eliminate a separate
event-based collector, and extracts a fallback display name into a
string resource.
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>1 parent 65ed2e5 commit f0a736f
3 files changed
Lines changed: 57 additions & 48 deletions
File tree
- apps/flipcash
- core/src/main/res/values
- features/direct-send/src/main/kotlin/com/flipcash/app/directsend
- internal
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
| 743 | + | |
743 | 744 | | |
744 | 745 | | |
745 | 746 | | |
| |||
Lines changed: 24 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
| |||
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
38 | | - | |
39 | 34 | | |
40 | 35 | | |
41 | 36 | | |
| |||
91 | 86 | | |
92 | 87 | | |
93 | 88 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
110 | 97 | | |
111 | 98 | | |
112 | 99 | | |
113 | 100 | | |
114 | 101 | | |
115 | 102 | | |
| 103 | + | |
| 104 | + | |
116 | 105 | | |
117 | 106 | | |
118 | 107 | | |
119 | 108 | | |
120 | 109 | | |
121 | | - | |
| 110 | + | |
122 | 111 | | |
123 | 112 | | |
124 | 113 | | |
| |||
143 | 132 | | |
144 | 133 | | |
145 | 134 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
159 | 143 | | |
160 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
161 | 149 | | |
162 | 150 | | |
163 | 151 | | |
| |||
Lines changed: 32 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| |||
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
111 | | - | |
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
| |||
223 | 231 | | |
224 | 232 | | |
225 | 233 | | |
226 | | - | |
227 | | - | |
228 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
229 | 242 | | |
230 | | - | |
| 243 | + | |
231 | 244 | | |
232 | 245 | | |
233 | 246 | | |
| |||
283 | 296 | | |
284 | 297 | | |
285 | 298 | | |
286 | | - | |
287 | 299 | | |
288 | 300 | | |
289 | | - | |
290 | 301 | | |
291 | 302 | | |
292 | 303 | | |
293 | 304 | | |
294 | | - | |
295 | 305 | | |
296 | 306 | | |
297 | 307 | | |
| |||
362 | 372 | | |
363 | 373 | | |
364 | 374 | | |
365 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
366 | 378 | | |
367 | | - | |
368 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
369 | 390 | | |
370 | 391 | | |
371 | 392 | | |
| |||
376 | 397 | | |
377 | 398 | | |
378 | 399 | | |
379 | | - | |
380 | 400 | | |
381 | 401 | | |
382 | 402 | | |
| |||
0 commit comments