feat: show Sign in CTA when dotli has no session#7
Merged
Conversation
Catch RequestCredentialsErr::NotConnected from accountGet and route to a new 'signed-out' state instead of the raw error screen. App.tsx renders a 'Sign in to dotli to play' message with a button that calls accountsProvider.requestLogin() and re-runs connectAccount on resolve. Skipped the connection-status subscription on purpose — primary flow (click button -> pair -> game) doesn't need it. Edge cases (user signs in via dotli topbar instead of our button, or signs out mid-session) recover on the next user action.
todortodorovic
approved these changes
May 20, 2026
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.
Why
Cold-start (fresh browser, RevX/WebContainer preview, any session where dotli isn't paired) shows this raw error before the user can do anything:
That's dotli's correct behavior — its
handleAccountGetreturnsNotConnectedwhenever there's no authenticated session. The SPA just wasn't surfacing it as a normal UI state.What
RequestCredentialsErr.NotConnected(instanceof— the codec-error class definesSymbol.hasInstance) and route to a newsigned-outstatus instead oferror.signIn()helper: callsaccountsProvider.requestLogin(...)then re-runsconnectAccount(). Onrejected, the nextaccountGetreturnsNotConnectedagain and the UI lands back on the sign-in screen — no special-case branch needed.App.tsxrenders "Sign in to dotli to play Rock Paper Scissors." + a Sign in button whenstatus === "signed-out". Other states (idle, connecting, ready, error) unchanged.24 insertions, 2 deletions across two files.
Flow
accountGetreturnsNotConnected→ state goes tosigned-out→ CTA renders.requestLoginopens dotli's QR / PAPP pairing UI → user pairs →connectAccountretries → game loads.Not in scope
No
accountConnectionStatusSubscribesubscription. Two edge cases that gracefully degrade without it:requestLoginthen returnsalreadyConnectedinstantly.Easy to add the subscription later if either becomes a real friction point.
Verified
bunx vite build).bun run build:frontendis currently red onmainbecause of a pre-existingTS2554in the9aea38a fix sign txcommit (getProductAccountSigner(productAccount, "createTransaction")— the second arg requires@novasamatech/product-sdk ≥ 0.7.9-5, butpackage.jsonpins0.7.8-2). Unrelated to this PR, worth raising separately.