Release 2: Update Search page to use live Onyx data if available
Next, we'll update the Onyx snapshot system (which is used by all Reports pages) to use live Onyx data if available.
- In App, update the useOnyx hook with the following
- Get original live Onyx data
- Get snapshot search data if we can use snapshot data, i.e.
const canUseSnapshot = isOnSearch && !!currentSearchHash && isSnapshotCompatibleKey;
- Combine the results of a and b, always overriding snapshot data with live Onyx data, i.e.
{...snapshotData, …originalData}
- Return the combined data
- We already use the useOnyx wrapper throughout the App, so this change is enough to update all instances of Search data to use live Onyx data first and then fallback to snapshot data.
Issue Owner
Current Issue Owner: @heyjennahay