From b9ccb0dfb6a38ab6ef306c49d440377d308978fd Mon Sep 17 00:00:00 2001 From: elpatron Date: Sat, 30 May 2026 14:09:54 +0200 Subject: [PATCH] =?UTF-8?q?fix(client):=20Read-only-UI=20nur=20bei=20best?= =?UTF-8?q?=C3=A4tigter=20READ-Rolle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Während des Ladens geteilter Logbücher wird Schreibzugriff nicht mehr fälschlich gesperrt; der Zugriffs-Effect setzt bei fehlendem Record kein OWNER mehr. Co-authored-by: Cursor --- client/src/App.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 9f8c3a6..58e2a02 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -85,13 +85,17 @@ function App() { return } - if (activeLogbookRecord?.isShared !== 1) { + if (!activeLogbookRecord) { + setActiveAccessRole(null) + return + } + + if (activeLogbookRecord.isShared !== 1) { setActiveAccessRole('OWNER') return } const cachedRole = activeLogbookRecord.collaborationRole - // Fail-closed for write UI until role is known: do not assume WRITE setActiveAccessRole( cachedRole ? parseCollaborationRole(cachedRole, `logbook ${activeLogbookId}`) : null ) @@ -418,12 +422,8 @@ function App() { const pwaInstallBanner = - const sharedLogbook = - activeLogbookRecord === undefined ? null : activeLogbookRecord.isShared === 1 const logbookReadOnly = - activeLogbookId != null && - (sharedLogbook === null || sharedLogbook) && - activeAccessRole !== 'WRITE' + activeLogbookRecord?.isShared === 1 && activeAccessRole === 'READ' if (!activeLogbookId) { return (