feat: Implement UI enhancements and fix burst bug
This commit is contained in:
@@ -5,6 +5,11 @@ const logFileUri = FileSystem.documentDirectory + 'app_logs.txt';
|
||||
// Queue to serialize file operations and prevent race conditions
|
||||
const logQueue: string[] = [];
|
||||
let isWriting = false;
|
||||
let isEnabled = true;
|
||||
|
||||
export const setLogsEnabled = (enabled: boolean) => {
|
||||
isEnabled = enabled;
|
||||
};
|
||||
|
||||
const processLogQueue = async () => {
|
||||
if (isWriting) return;
|
||||
@@ -48,6 +53,7 @@ const enqueueWrite = async (logLine: string) => {
|
||||
|
||||
export const logger = {
|
||||
log: async (message: string) => {
|
||||
if (!isEnabled) return;
|
||||
const timestamp = new Date().toISOString();
|
||||
const logLine = `[INFO] ${timestamp}: ${message}\n`;
|
||||
console.log(logLine.trim());
|
||||
@@ -55,6 +61,10 @@ export const logger = {
|
||||
},
|
||||
|
||||
error: async (message: string, error?: any) => {
|
||||
if (!isEnabled) {
|
||||
console.error(`[ERROR]: ${message}`, error);
|
||||
return;
|
||||
}
|
||||
const timestamp = new Date().toISOString();
|
||||
let errorString = '';
|
||||
if (error) {
|
||||
|
||||
@@ -21,6 +21,10 @@ export interface AppSettings {
|
||||
burstIntervalSec: number; // seconds between burst shots
|
||||
// Welcome screen text
|
||||
welcomeText: string;
|
||||
footerText: string;
|
||||
// System
|
||||
useFrontCamera: boolean;
|
||||
enableLogs: boolean;
|
||||
}
|
||||
|
||||
const settingsFile = new File(Paths.document, 'settings.json');
|
||||
@@ -39,6 +43,9 @@ const DEFAULT_SETTINGS: AppSettings = {
|
||||
burstCount: 1,
|
||||
burstIntervalSec: 5,
|
||||
welcomeText: 'Willkommen zu unserer Feier!',
|
||||
footerText: 'ZUM STARTEN TIPPEN • Fotos machen • Collage • Drucken',
|
||||
useFrontCamera: false,
|
||||
enableLogs: true,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user