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

Do not show most recent comment on locationDetails #491

Closed RyanTG closed 1 year ago

RyanTG commented 1 year ago

Nor the “last updated” text. On location details, it’ll just be the machine name. When clicked you can then see all comments on machine Details (as you do now).

When making this change, I want to see if we can get some data savings by using the no_details=1 flag. I’m not sure if there is any info we’d be missing if we used that flag. But I think using that flag would really speed up that screen. The comments can be a lot of data.

RyanTG commented 1 year ago

Ah, I just realized there is no no_details=1 flag for the /api/v1/locations/:id.json which is what we're using here: https://github.com/pinballmap/pbm-react/blob/6794e2c1135bbcf375363d1080b567fcbe0ee66d/app/actions/location_actions.js#L34

So I'm going to add no details to the endpoint and exclude comments and include everything else we need.

RyanTG commented 1 year ago

Flag added. https://github.com/pinballmap/pbm/commit/0ec77a59caee1e92bc48b824b8d4776feb14464e

Seeing a decent reduction in page load times. Like 143 ms vs 313 ms

RyanTG commented 1 year ago

added as part of this https://github.com/pinballmap/pbm-react/commit/c21ced6827bf14642b54ea764eb12d91f8782d57