mirror of
https://github.com/SagerNet/sing-box-for-apple.git
synced 2026-05-04 11:32:29 +00:00
26 lines
570 B
Swift
26 lines
570 B
Swift
import Library
|
|
import SwiftUI
|
|
|
|
@MainActor
|
|
final class SettingViewModel: BaseViewModel {
|
|
@Published var taiwanFlagAvailable = false
|
|
|
|
override init() {
|
|
super.init()
|
|
isLoading = true
|
|
}
|
|
|
|
nonisolated func checkTaiwanFlagAvailability() async {
|
|
let available: Bool
|
|
if Variant.screenshotMode {
|
|
available = true
|
|
} else {
|
|
available = !DeviceCensorship.isChinaDevice()
|
|
}
|
|
await MainActor.run {
|
|
taiwanFlagAvailable = available
|
|
isLoading = false
|
|
}
|
|
}
|
|
}
|