chore: update app configurations and screens
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { File, Paths } from 'expo-file-system';
|
||||
import * as FileSystem from 'expo-file-system';
|
||||
import { FRAMES } from '../data/frames';
|
||||
|
||||
export interface AppSettings {
|
||||
countdownDuration: number; // in seconds
|
||||
@@ -28,9 +30,9 @@ const DEFAULT_SETTINGS: AppSettings = {
|
||||
printerIp: '192.168.1.100',
|
||||
adminPassword: '1234',
|
||||
kioskModeEnabled: false,
|
||||
frameMode: 'off',
|
||||
frameMode: 'available',
|
||||
selectedFrameId: null,
|
||||
availableFrameIds: [],
|
||||
availableFrameIds: FRAMES.map(f => f.id),
|
||||
dateOverlay: 'off',
|
||||
dateOverlayPosition: 'bottom-right',
|
||||
eventText: '',
|
||||
@@ -61,7 +63,7 @@ export async function loadSettings(): Promise<AppSettings> {
|
||||
export async function saveSettings(settings: AppSettings): Promise<void> {
|
||||
try {
|
||||
const content = JSON.stringify(settings, null, 2);
|
||||
settingsFile.write(content);
|
||||
await FileSystem.writeAsStringAsync(settingsFile.uri, content);
|
||||
console.log('Settings saved successfully:', content);
|
||||
} catch (e) {
|
||||
console.error('Failed to save settings:', e);
|
||||
|
||||
Reference in New Issue
Block a user