You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quoting @hichamboushaba from an internal thread p1715164179010139-slack-C03L1NF1EA3
Problem
Currently, to detect if a site has orders or not following this (at least in Android):
We check how many orders we have in the DB, and if we have a non-zero count, we decide that the site has orders.
If we don’t have cached orders, we fetch the order’s count from the API.
This logic has a side effect, that for stores with orders, and before fetching the order list, we have a “flicker” in the dashboard caused by showing the “Share Store” card then hiding it after the API call (point 2), see the video for understanding what I mean.
RPReplay_Final1715164598.MP4
Solution
The new logic I suggest:
Start with cached order’s count, and if it’s != 0, then use it directly.
If there are no cached orders, check the cached value of order status options we get from the above endpoint, and if it’s not empty, then sum the total of all its values*.
If there are no cached values, then revert to fetching the order’s count from the API using the existing logic that we use now.
The text was updated successfully, but these errors were encountered:
selanthiraiyan
changed the title
Improving the logic of detecting if a site has orders
Dashboard: Improving the logic of detecting if a site has orders
May 15, 2024
Quoting @hichamboushaba from an internal thread p1715164179010139-slack-C03L1NF1EA3
Problem
Currently, to detect if a site has orders or not following this (at least in Android):
This logic has a side effect, that for stores with orders, and before fetching the order list, we have a “flicker” in the dashboard caused by showing the “Share Store” card then hiding it after the API call (point 2), see the video for understanding what I mean.
RPReplay_Final1715164598.MP4
Solution
The new logic I suggest:
The text was updated successfully, but these errors were encountered: