Bugfixes: - Add toggle for offline mode simulation (DEBUG only) - Fix VPN false-positives with interface count check - Add detailed error logging for download failures - Fix last sync timestamp display - Translate all strings to English Network Monitoring: - Add NetworkMonitorRepository with NWPathMonitor - Check path.status AND availableInterfaces for reliability - Add manual reportConnectionFailure/Success methods - Auto-load cached bookmarks when offline - Visual debug banner (green=online, red=offline) Architecture: - Clean architecture with Repository → UseCase → ViewModel - Network status in AppSettings for global access - Combine publishers for reactive updates
43 lines
710 B
Swift
43 lines
710 B
Swift
//
|
|
// AppSettings.swift
|
|
// readeck
|
|
//
|
|
// Created by Ilyas Hallak on 21.07.25.
|
|
//
|
|
|
|
|
|
//
|
|
// AppSettings.swift
|
|
// readeck
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
//
|
|
|
|
import Foundation
|
|
import Combine
|
|
|
|
class AppSettings: ObservableObject {
|
|
@Published var settings: Settings?
|
|
@Published var isNetworkConnected: Bool = true
|
|
|
|
var enableTTS: Bool {
|
|
settings?.enableTTS ?? false
|
|
}
|
|
|
|
var theme: Theme {
|
|
settings?.theme ?? .system
|
|
}
|
|
|
|
var urlOpener: UrlOpener {
|
|
settings?.urlOpener ?? .inAppBrowser
|
|
}
|
|
|
|
var tagSortOrder: TagSortOrder {
|
|
settings?.tagSortOrder ?? .byCount
|
|
}
|
|
|
|
init(settings: Settings? = nil) {
|
|
self.settings = settings
|
|
}
|
|
}
|