Show chat reminders only when the host rail is unavailable

This commit is contained in:
coyotte508 2026-09-30 14:26:03 +02:00
commit 81315ea484
3 changed files with 5 additions and 1 deletions

View file

@ -642,7 +642,9 @@
(s.phase === "equipment" && me.ready && !canReopenChoice(s, seat!)) ||
(s.phase === "eruption" && seat !== 0)}>{mobileLabel} →</button
>
{#if store.chatAvailable && store.chatState.unreadIds.length}<button class="dock-chat" onclick={openChat}
{#if store.chatAvailable && store.chatNotifications && store.chatState.unreadIds.length}<button
class="dock-chat"
onclick={openChat}
>Chat{store.chatState.unreadIds.length ? ` · ${store.chatState.unreadIds.length}` : ""}</button
>{/if}
</div>{/if}

View file

@ -3,6 +3,7 @@ import { SoundDesign, type SoundCue } from "./sound";
import type { View, Move } from "fuji-engine";
export class Store {
analysis = $state(false);
chatNotifications = $state(true);
chat = new ChatController();
chatState = $state.raw(this.chat.snapshot);
chatAvailable = $derived(this.chatState.enabled && !this.analysis);

View file

@ -40,6 +40,7 @@ registerViewer<View, Move>(
return;
}
store.analysis = preferences.analysis === true;
store.chatNotifications = preferences.chatNotifications !== false;
store.colorblind = preferences.colorBlind === true;
store.setSound(preferences.sound !== false);
},