Commit d249fa5
committed
fix: allow offline usage of app picker
Don't show the list of apps only if we failed to fetch it,
and not whenever we're offline.
This also fixes an annoying bug where the app picker
would show "offline" if you opened it
during "updating" network status,
which notably also happens when you just focused the window
(due to a `rpc.maybeNetwork()` call).
And this has been causing E2E test failures recently.
`getHttpResponse` is able to cache data since not so long ago,
so let's utilize that.
Note that the fact that we have cached the list of apps
doesn't mean that all the apps themselved are cached,
so users might still encounter an error.
However, if the list of apps and the app file is cached,
this allows you, even when offline,
to send an app to the chat and open it.
This change also makes sense even if `getHttpResponse`
didn't do any caching. We do not rely on this.1 parent 77181e8 commit d249fa5
File tree
2 files changed
+35
-16
lines changed- packages/frontend/src/components/AppPicker
2 files changed
+35
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 110 | | |
114 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
115 | 127 | | |
116 | 128 | | |
117 | 129 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 130 | | |
124 | 131 | | |
125 | 132 | | |
| |||
307 | 314 | | |
308 | 315 | | |
309 | 316 | | |
310 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
311 | 330 | | |
312 | 331 | | |
313 | 332 | | |
| |||
316 | 335 | | |
317 | 336 | | |
318 | 337 | | |
319 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
320 | 341 | | |
321 | 342 | | |
322 | 343 | | |
| |||
326 | 347 | | |
327 | 348 | | |
328 | 349 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | 350 | | |
334 | 351 | | |
335 | 352 | | |
| |||
0 commit comments