Add preview support

This commit is contained in:
世界 committed 2023-07-20 13:15:13 +08:00
1 parent fdbf50d875
commit 251f441a25
14 files changed
+135 -59

No files matched your search

@@ -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() {