[C-832] Add local-storage service to saga context#1718
Conversation
|
|
||
| // Init APICLient | ||
| yield* call(() => apiClient.init()) | ||
| apiClient.init() |
There was a problem hiding this comment.
Why remove the yield here when we made init async?
There was a problem hiding this comment.
oh yeah i can bring that back, i actually didnt make it async since it was messing up a lot of places and for very little upside, which is just to init the eager discovery provider, which is only a web thing anyway.
| localStorage: LocalStorageType | ||
| } | ||
|
|
||
| export class LocalStorage { |
There was a problem hiding this comment.
Did you make this a class instead of a function for consistency with the other services?
There was a problem hiding this comment.
yeah i guess so, happy to make a function if we think it makes more sense though.
| waitForValue, | ||
| (state) => state.account.status, | ||
| null, | ||
| (status) => status !== Status.LOADING |
There was a problem hiding this comment.
yeah this felt good, thank the lord, lol
|
Preview this change https://demo.audius.co/dj-c-832-make-local-storage-service-native-compatible |
Description
Adds local-storage service to saga context.
Updates getAccount usages to wait until account is loaded (since it is now async) before requesting it
Dragons
There may be subtle places where we are meaning to request data with an authenticated user, but instead are doing the public fetch. There may be other places that are expecting an account right away even though it is still loading. I believe I have covered the majority of places
How Has This Been Tested?
Running staging and prod and going through the major flows.
How will this change be monitored?
Looking for any issues in sentry that result from this change, as well as responding to any internal feedback of loading issues.