Skip to content

Commit

Permalink
fix(ui): update auth type selection when account changes
Browse files Browse the repository at this point in the history
  • Loading branch information
skjsjhb committed Feb 28, 2025
1 parent c43cedf commit 6acf56c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/pages/create-game/CreateGameView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export function CreateGameView() {
const [shareContainer, setShareContainer] = useState(false);

const [lastSelectedAccountId, setLastSelectedAccountId] = useLocalStorage<string>("create-game.account.last-selected");
const initialAccountId = accounts.some(a => a.uuid === lastSelectedAccountId) ? lastSelectedAccountId : null;

const [authType, setAuthType] = useState<"new-vanilla" | "manual" | "reuse">(lastSelectedAccountId ? "reuse" : "new-vanilla");
const [authType, setAuthType] = useState<"new-vanilla" | "manual" | "reuse">(initialAccountId ? "reuse" : "new-vanilla");

const initialAccountId = accounts.some(a => a.uuid === lastSelectedAccountId) ? lastSelectedAccountId : null;
const [accountId, setAccountId] = useState<string | null>(initialAccountId ?? null);

const [playerName, setPlayerName] = useState<string>("Player");
Expand Down

0 comments on commit 6acf56c

Please sign in to comment.