Add preview support

This commit is contained in:
世界
2023-07-20 13:15:13 +08:00
parent fdbf50d875
commit 251f441a25
14 changed files with 135 additions and 59 deletions
@@ -148,10 +148,16 @@ public struct SettingView: View {
#endif
disableMemoryLimit = SharedPreferences.disableMemoryLimit
version = LibboxVersion()
dataSize = "Loading..."
isLoading = false
dataSize = (try? FilePath.workingDirectory.formattedSize()) ?? "Unknown"
taiwanFlagAvailable = !DeviceCensorship.isChinaDevice()
if ApplicationLibrary.inPreview {
dataSize = LibboxFormatBytes(1024 * 1024 * 10)
taiwanFlagAvailable = true
isLoading = false
} else {
dataSize = "Loading..."
taiwanFlagAvailable = !DeviceCensorship.isChinaDevice()
isLoading = false
dataSize = (try? FilePath.workingDirectory.formattedSize()) ?? "Unknown"
}
}
private func clearWorkingDirectory() {