store split 4#29166
Conversation
* modal header * remove tracker store * pinentry * unlock * archive
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 110 out of 124 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const {cancelLabel, prompt, retryLabel, showTyping, submitLabel, type, windowTitle} = popupState | ||
| const show = type !== T.RPCGen.PassphraseType.none && !!showTyping | ||
| const darkMode = useColorScheme() === 'dark' |
There was a problem hiding this comment.
The pinentry window is only shown when type !== PassphraseType.none && !!showTyping. showTyping is a Feature object and may be undefined depending on the daemon response; gating visibility on it can suppress the pinentry UI entirely. The show/hide condition should depend on whether a passphrase is being requested (i.e., type !== PassphraseType.none), and showTyping should only control whether the input is masked/visible inside the window.
| const rpcRowColorToColor = (color: T.RPCGen.Identify3RowColor): T.Tracker.AssertionColor => { | ||
| switch (color) { | ||
| case T.RPCGen.Identify3RowColor.blue: | ||
| return 'blue' | ||
| case T.RPCGen.Identify3RowColor.red: | ||
| return 'red' | ||
| case T.RPCGen.Identify3RowColor.black: | ||
| return 'black' | ||
| case T.RPCGen.Identify3RowColor.green: | ||
| return 'green' | ||
| case T.RPCGen.Identify3RowColor.gray: | ||
| return 'gray' | ||
| case T.RPCGen.Identify3RowColor.yellow: | ||
| return 'yellow' | ||
| case T.RPCGen.Identify3RowColor.orange: | ||
| return 'orange' | ||
| } | ||
| } | ||
|
|
||
| const rpcRowStateToAssertionState = (state: T.RPCGen.Identify3RowState): T.Tracker.AssertionState => { | ||
| switch (state) { | ||
| case T.RPCGen.Identify3RowState.checking: | ||
| return 'checking' | ||
| case T.RPCGen.Identify3RowState.valid: | ||
| return 'valid' | ||
| case T.RPCGen.Identify3RowState.error: | ||
| return 'error' | ||
| case T.RPCGen.Identify3RowState.warning: | ||
| return 'warning' | ||
| case T.RPCGen.Identify3RowState.revoked: | ||
| return 'revoked' | ||
| } | ||
| } |
There was a problem hiding this comment.
rpcRowColorToColor and rpcRowStateToAssertionState don't have a default case, so at runtime an unexpected enum value will return undefined even though the return types are non-optional. This can leak undefined into Assertion.color / Assertion.state and cause downstream rendering issues. Add an explicit default branch (and optionally log) to ensure a safe fallback value.
No description provided.