Fix vehicle icon lookup and default web account selection
Match archive paths without regard to case and include Golden Eagle vehicles in icon extraction. Default read-only page state to the current in-game account. Keep web mutations gated on an explicit account ID. Type checking and local icon and account selection checks passed. In-game acceptance is pending.
This commit is contained in:
1 parent
26fd6b51b7
commit
ec2d3ffbc4
6 files changed
+63
-24
No files matched your search
@@ -70,11 +70,12 @@ export function jsonResponse(payload: unknown, summary: string): ServiceResponse
|
||||
/**
|
||||
* Select the account displayed in a read-only web state query:
|
||||
* - when `requestedUserId` is provided, look up that exact account (never falling back to another);
|
||||
* - when `requestedUserId` is omitted on initial page load, default the UI selector to the first registered account.
|
||||
* - when `requestedUserId` is omitted on initial page load, default the UI selector to the account
|
||||
* currently signed into the game in this session, or the first registered account otherwise.
|
||||
*/
|
||||
export function selectWebViewAccount(accounts: AccountStore, requestedUserId: string | null): Account | undefined {
|
||||
const trimmed = requestedUserId?.trim() ?? '';
|
||||
return trimmed ? accounts.byUserId(trimmed) : accounts.all()[0];
|
||||
return trimmed ? accounts.byUserId(trimmed) : (accounts.lastSignedIn() ?? accounts.all()[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user