- Implemented a toggle for the 'Read Aloud' (TTS) feature in the general settings. - Refactored AppSettings and PlayerUIState to support TTS enable/disable. - Updated BookmarkDetailView, PadSidebarView, PhoneTabView, and GlobalPlayerContainerView to respect the TTS setting. - Added new RButton component for consistent button styling. - Improved LabelsView to support tag selection on iPad and iPhone. - Updated SettingsGeneralView and SettingsGeneralViewModel for new TTS logic and removed unused app info code. - Added app info section to SettingsContainerView. - Updated SettingsServerView to use English labels and messages. - Refactored SpeechPlayerViewModel to only initialize TTS when enabled. - Updated Core Data model to include enableTTS in SettingEntity. - Removed obsolete files (PersistenceController.swift, old PlayerUIState). - Various bugfixes, code cleanups, and UI improvements.
52 lines
1.3 KiB
Swift
52 lines
1.3 KiB
Swift
//
|
|
// readeckApp.swift
|
|
// readeck
|
|
//
|
|
// Created by Ilyas Hallak on 10.06.25.
|
|
//
|
|
|
|
import SwiftUI
|
|
import netfox
|
|
|
|
@main
|
|
struct readeckApp: App {
|
|
@State private var hasFinishedSetup = true
|
|
@StateObject private var appSettings = AppSettings()
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
Group {
|
|
if hasFinishedSetup {
|
|
MainTabView()
|
|
} else {
|
|
SettingsServerView()
|
|
.padding()
|
|
}
|
|
}
|
|
.environmentObject(appSettings)
|
|
.onAppear {
|
|
#if DEBUG
|
|
NFX.sharedInstance().start()
|
|
#endif
|
|
Task {
|
|
await loadSetupStatus()
|
|
}
|
|
}
|
|
.onReceive(NotificationCenter.default.publisher(for: NSNotification.Name("SetupStatusChanged"))) { _ in
|
|
Task {
|
|
await loadSetupStatus()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private func loadSetupStatus() async {
|
|
let settingsRepository = SettingsRepository()
|
|
hasFinishedSetup = settingsRepository.hasFinishedSetup
|
|
let settings = try? await settingsRepository.loadSettings()
|
|
await MainActor.run {
|
|
appSettings.settings = settings
|
|
}
|
|
}
|
|
}
|