mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
5644e3d77e
Every vacay refresh on desktop (opening the page, a vacay:settings or vacay:invite update from another member) sent a second GET /trips just to redraw the same trip dots, even when the leave-year window had not changed. Cause: useVacayCalendarLogic keyed the trip dot reload on the year settings object when tripsFollowWindowShape was false (the desktop grid). loadAll() replaces that object with a deep-equal copy on every refresh, so the effect ran again. The phone screen already keyed it on the window shape. Fix: the trip dots always reload on the window shape (year type, start month, start day, hire date), which covers every field the dot filter reads. The option only existed to keep the desktop behaviour, so it is removed from the hook and from both callers. Red test: FE-COMP-VACAYCAL-010 (useVacayCalendarLogic.test.ts) failed on the unfixed code with "AssertionError: expected "list" to be called 1 times, but got 2 times". Changed assertions: - useVacayCalendarLogic.test.ts FE-COMP-VACAYCAL-010: was "the desktop mode reloads trips on every new settings object" expecting tripsApi.list to be called 2 times after a deep-equal settings replacement; now expects 1. - FE-COMP-VACAYCAL-011 no longer passes tripsFollowWindowShape and no longer names the phone mode; its assertions are unchanged.