Skip to content

Commit 6d4ed01

Browse files
committed
Minor fixes
1 parent 5e2af0a commit 6d4ed01

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

ApplicationLibrary/Views/Abstract/ShareButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public struct ShareButtonCompat<Label>: View where Label: View {
7676
#if os(iOS)
7777
private nonisolated func shareItem0() async {
7878
do {
79-
let shareItem = try itemURL()
79+
let shareItem = try await itemURL()
8080
await MainActor.run {
8181
shareItem1(shareItem)
8282
}

ApplicationLibrary/Views/Groups/GroupItemView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public struct GroupItemView: View {
7171
do {
7272
try await LibboxNewStandaloneCommandClient()!.selectOutbound(group.tag, outboundTag: item.tag)
7373
var newGroup = await group
74-
newGroup.selected = item.tag
74+
newGroup.selected = await item.tag
7575
await MainActor.run { [newGroup] in
7676
_group.wrappedValue = newGroup
7777
}

ApplicationLibrary/Views/Profile/EditProfileView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public struct EditProfileView: View {
162162
do {
163163
_ = try await ProfileManager.update(profile)
164164
#if os(iOS) || os(tvOS)
165-
try await UIProfileUpdateTask.configure()
165+
try UIProfileUpdateTask.configure()
166166
#else
167167
try await ProfileUpdateTask.configure()
168168
#endif

ApplicationLibrary/Views/Profile/NewProfileView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public struct NewProfileView: View {
243243
))
244244
if profileType == .remote {
245245
#if os(iOS) || os(tvOS)
246-
try await UIProfileUpdateTask.configure()
246+
try UIProfileUpdateTask.configure()
247247
#else
248248
try await ProfileUpdateTask.configure()
249249
#endif

ApplicationLibrary/Views/Setting/CoreView.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Libbox
33
import Library
44
import SwiftUI
55

6+
@MainActor
67
public struct CoreView: View {
78
@State private var isLoading = true
89

@@ -51,13 +52,17 @@ public struct CoreView: View {
5152

5253
private nonisolated func loadSettings() async {
5354
if ApplicationLibrary.inPreview {
54-
version = "<redacted>"
55-
dataSize = LibboxFormatBytes(1000 * 1000 * 10)
56-
isLoading = false
55+
await MainActor.run {
56+
version = "<redacted>"
57+
dataSize = LibboxFormatBytes(1000 * 1000 * 10)
58+
isLoading = false
59+
}
5760
} else {
58-
version = LibboxVersion()
59-
dataSize = "Loading..."
60-
isLoading = false
61+
await MainActor.run {
62+
version = LibboxVersion()
63+
dataSize = "Loading..."
64+
isLoading = false
65+
}
6166
await loadSettingsBackground()
6267
}
6368
}

Library/Network/CommandClient.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ public class CommandClient: ObservableObject {
8585
}
8686

8787
private func initializeConnectionFilterState() async {
88-
connectionStateFilter = await .init(rawValue: SharedPreferences.connectionStateFilter.get()) ?? .all
89-
connectionSort = await .init(rawValue: SharedPreferences.connectionSort.get()) ?? .byDate
88+
let newFilter: ConnectionStateFilter = await .init(rawValue: SharedPreferences.connectionStateFilter.get()) ?? .active
89+
let newSort: ConnectionSort = await .init(rawValue: SharedPreferences.connectionSort.get()) ?? .byDate
90+
await MainActor.run {
91+
connectionStateFilter = newFilter
92+
connectionSort = newSort
93+
}
9094
}
9195

9296
private nonisolated func connect0() async {
@@ -111,7 +115,7 @@ public class CommandClient: ObservableObject {
111115
case .log:
112116
clientOptions.statusInterval = Int64(500 * NSEC_PER_MSEC)
113117
default:
114-
clientOptions.statusInterval = Int64(2 * NSEC_PER_SEC)
118+
clientOptions.statusInterval = Int64(NSEC_PER_SEC)
115119
}
116120
let client = LibboxNewCommandClient(clientHandler(self), clientOptions)!
117121
do {

0 commit comments

Comments
 (0)