pinballmap / pbm-react

PBM React Native: iOS & Android Apps
https://pinballmap.com/app
GNU General Public License v3.0
33 stars 9 forks source link

Handle deleted locations when clicking from Recent Activity #549

Closed RyanTG closed 3 months ago

RyanTG commented 4 months ago

Sometimes locations have been deleted, but are listed in activity in Recent Activity. Clicking recent activity items is supposed to open that location screen. But if the location has been deleted, the screen just spins.

One current example is to search for Omaha, NE. Then go to recent activity and scroll down until you see activity for Billy Frogg’s Grill & Bar. That’s a deleted location example.

bpoore commented 4 months ago

Will get a fix in for that. From the perspective of the API, would it be difficult to remove the location data from recent activity?

RyanTG commented 4 months ago

On the website, it seems like when a location is deleted, we would need some sort of function that looks up the user_submissions that contain that location_id and then clears out the location_id field. We don't have anything like that right now. But if you think that's the best solution, we could look into it.

bpoore commented 4 months ago

Oh no, it's enough of an edge-case, not necessary. We just can't offer the ability to the user to remove the item from the activity feed in this case... again edge-case, so no worries.

Does this seem ok? On the attempt to navigate to the location details screen, if the location is gone, pop the alert and go back. From a previously saved search, we had to fetch the location details before navigating to the location to begin with (why we don't get the flash of initially navigating to location details). We could fetch the location details here as well to avoid this glitchy behavior, but the trade-off would be making double requests for every navigation to a location from the activity feed. With how much this is an edge case, I figured we'd be fine with this, but happy to update depending on how you feel.

Branch if you'd like to play with it.

https://github.com/pinballmap/pbm-react/assets/7720282/af32ba2e-ce4f-4dd7-94bd-ef2bc7321e69

RyanTG commented 4 months ago

I'm definitely ok with that extra movement, as it is. It kind of shows "look, we tried, but it's gone!"