From e540feba44342ec327aaa1118cc324ae89c466ba Mon Sep 17 00:00:00 2001 From: Padreug Date: Thu, 21 May 2026 16:13:22 +0200 Subject: [PATCH] refactor(activities): useApprovalState composable Both the activities-app shell and EventsPage probed isAdmin / autoApprove with slightly different code, both needed by the edit dialog's warning copy. Extract into a single composable so the probe sequence + re-probe-on-auth-flip behavior lives in one place. Also clear editingEvent eagerly when the bottom-nav Create tab fires so a Create tap never inherits a stale Edit selection from a prior close path that didn't run for any reason. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/activities-app/App.vue | 31 ++++-------- .../composables/useApprovalState.ts | 49 +++++++++++++++++++ src/modules/activities/views/EventsPage.vue | 22 ++------- 3 files changed, 61 insertions(+), 41 deletions(-) create mode 100644 src/modules/activities/composables/useApprovalState.ts diff --git a/src/activities-app/App.vue b/src/activities-app/App.vue index 0babbc0..dc3ada6 100644 --- a/src/activities-app/App.vue +++ b/src/activities-app/App.vue @@ -1,5 +1,5 @@