fix(10-04): prettier format + remove unnecessary type assertions

- Run prettier on all new/modified PWA files (CredentialSheet, SetupBanner, AdminPage, admin.spec.ts)
- Remove unnecessary 'as React.RefObject<HTMLElement | null>' casts flagged by @typescript-eslint/no-unnecessary-type-assertion
- Format pre-existing API files from Plans 02/03 (me.ts, user.test.ts, requireAdmin.test.ts, me.test.ts)
- All 270 API tests + 191 PWA vitest tests pass; lint/typecheck/build clean
This commit is contained in:
Lucas Berger
2026-06-13 15:22:50 -04:00
parent 7808426a2f
commit 79fe3e0e04
8 changed files with 89 additions and 56 deletions
+3 -5
View File
@@ -77,8 +77,7 @@ export function AdminPage() {
});
// Derive current saved shared calendar id from the data
const currentSharedId =
calendarsQuery.data?.calendars.find((c) => c.isShared)?.id ?? null;
const currentSharedId = calendarsQuery.data?.calendars.find((c) => c.isShared)?.id ?? null;
// Effective selected = user pick OR fallback to current saved
const effectiveSelected = selectedCalendarId ?? currentSharedId;
@@ -97,8 +96,7 @@ export function AdminPage() {
// Open credential sheet for a member
function openSheet(member: AdminMember, buttonRef: React.RefObject<HTMLButtonElement | null>) {
// Capture the button so focus can return on close
(triggerRef as React.MutableRefObject<HTMLElement | null>).current =
buttonRef.current;
(triggerRef as React.MutableRefObject<HTMLElement | null>).current = buttonRef.current;
setSheetMember(member);
setSheetMode(member.hasCredential ? 'admin-rotate' : 'admin-add');
setSheetOpen(true);
@@ -298,7 +296,7 @@ export function AdminPage() {
mode={sheetMode}
memberName={sheetMember.displayName}
memberId={sheetMember.id}
triggerRef={triggerRef as React.RefObject<HTMLElement | null>}
triggerRef={triggerRef}
/>
)}
</div>