Minor fixes

This commit is contained in:
世界
2024-10-13 21:16:49 +08:00
parent 5e2af0a5c7
commit 6d4ed01a6d
6 changed files with 22 additions and 13 deletions
@@ -3,6 +3,7 @@ import Libbox
import Library
import SwiftUI
@MainActor
public struct CoreView: View {
@State private var isLoading = true
@@ -51,13 +52,17 @@ public struct CoreView: View {
private nonisolated func loadSettings() async {
if ApplicationLibrary.inPreview {
version = "<redacted>"
dataSize = LibboxFormatBytes(1000 * 1000 * 10)
isLoading = false
await MainActor.run {
version = "<redacted>"
dataSize = LibboxFormatBytes(1000 * 1000 * 10)
isLoading = false
}
} else {
version = LibboxVersion()
dataSize = "Loading..."
isLoading = false
await MainActor.run {
version = LibboxVersion()
dataSize = "Loading..."
isLoading = false
}
await loadSettingsBackground()
}
}