feat(offline): offline lobby — list + create + play local vs_ai games [C6] #198
@@ -21,8 +21,11 @@
|
|||||||
// Seeded once from the entry route's tab, then owned locally. The effect keeps the tab valid:
|
// Seeded once from the entry route's tab, then owned locally. The effect keeps the tab valid:
|
||||||
// an AI game has only the Dictionary; a finished non-AI game has only Chat (a stale Dictionary
|
// an AI game has only the Dictionary; a finished non-AI game has only Chat (a stale Dictionary
|
||||||
// deep-link falls back to Chat).
|
// deep-link falls back to Chat).
|
||||||
|
// An honest-AI game has only the Dictionary, so start there regardless of the entry route — this
|
||||||
|
// keeps ChatScreen (which fetches chat over the network) from mounting even for a beat, which would
|
||||||
|
// otherwise raise an error toast in offline mode.
|
||||||
// svelte-ignore state_referenced_locally
|
// svelte-ignore state_referenced_locally
|
||||||
let tab = $state<CommsTab>(initialTab);
|
let tab = $state<CommsTab>(vsAi ? 'dictionary' : initialTab);
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (vsAi) tab = 'dictionary';
|
if (vsAi) tab = 'dictionary';
|
||||||
else if (tab === 'dictionary' && !active) tab = 'chat';
|
else if (tab === 'dictionary' && !active) tab = 'chat';
|
||||||
|
|||||||
Reference in New Issue
Block a user