Initial wallet selection: the page's current scope if it names a real * wallet, else the first wallet. Empty when single-wallet (field is hidden).
(subAccounts?: SubAccountRef[], preferred?: string)
| 124 | /** Initial wallet selection: the page's current scope if it names a real |
| 125 | * wallet, else the first wallet. Empty when single-wallet (field is hidden). */ |
| 126 | function initialWallet(subAccounts?: SubAccountRef[], preferred?: string): string { |
| 127 | if (!subAccounts || subAccounts.length <= 1) return '' |
| 128 | if (preferred && subAccounts.some(s => s.id === preferred)) return preferred |
| 129 | return subAccounts[0].id |
| 130 | } |
| 131 | |
| 132 | function PlaceForm({ initialAliceId, ...p }: SharedFormProps & { initialAliceId?: string }) { |
| 133 | const [aliceId, setAliceId] = useState(initialAliceId ?? '') |