fix(admin): let the PIN gate be cancelled instead of trapping the user - #167
Merged
Merged
Conversation
Cancel, Escape and a backdrop click all route to handlePinModalClose, which returned without acting whenever the panel was unauthenticated. That is every time the gate is shown, so all three did nothing. There is no other way out. The gate renders in place of the whole panel, and PinModal is a nested Dialog whose backdrop covers the containing dialog's close button; Escape only reaches the topmost modal, which is the one with the inert handler. The user has to reload the page. The early return reads as protection against revealing the panel un-authenticated, but the unauthenticated branch renders only the modal, so there is nothing behind it to protect. Cancelling now closes Admin and returns to the dashboard. The same shape applied to the set-PIN flow: with no PIN configured, opening Set Admin PIN and cancelling hit the mode === 'set' && !pinExists guard and trapped the user identically. Nothing forces that flow — it starts from a button — so the guard is removed and cancelling returns to the panel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening Admin on a device that needs the PIN gives a modal whose Cancel button does nothing. Escape does nothing. Clicking the backdrop does nothing. The only way out is to reload the page. This fixes that