Files
Kokorone/apps/mobile/lib/voice-autoplay-settings.ts
T
jiantw83andClaude Sonnet 5 1bea06e3cd feat(遊戲化): 新增大廳、附身、時間流、後日談進度等遊戲化系統功能
新增角色大廳(lobby)邀約與通話、附身(possession)、時鐘(clock)抽象、
時間流與睡眠負債、後日談進度、行為選擇與旁觀反應等模組,並補齊對應冒煙
測試(R~V)與單元測試;同步調整 web/mobile 對應頁面與元件。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-20 09:10:26 +08:00

15 lines
636 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import AsyncStorage from "@react-native-async-storage/async-storage";
const STORAGE_KEY = "kokorone:voice-autoplay-enabled";
// T20-P3:自走語音自動播放開關,對應 apps/web 的 lib/voice-autoplay-settings.ts;
// RN 沒有同步的 localStorage,AsyncStorage 一律回傳 Promise,呼叫端需 await。預設開啟。
export async function isVoiceAutoplayEnabled(): Promise<boolean> {
const stored = await AsyncStorage.getItem(STORAGE_KEY);
return stored !== "false";
}
export async function setVoiceAutoplayEnabled(enabled: boolean): Promise<void> {
await AsyncStorage.setItem(STORAGE_KEY, String(enabled));
}