File tree Expand file tree Collapse file tree 6 files changed +22
-13
lines changed Expand file tree Collapse file tree 6 files changed +22
-13
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public struct ShareButtonCompat<Label>: View where Label: View {
76
76
#if os(iOS)
77
77
private nonisolated func shareItem0( ) async {
78
78
do {
79
- let shareItem = try itemURL ( )
79
+ let shareItem = try await itemURL ( )
80
80
await MainActor . run {
81
81
shareItem1 ( shareItem)
82
82
}
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ public struct GroupItemView: View {
71
71
do {
72
72
try await LibboxNewStandaloneCommandClient ( ) !. selectOutbound ( group. tag, outboundTag: item. tag)
73
73
var newGroup = await group
74
- newGroup. selected = item. tag
74
+ newGroup. selected = await item. tag
75
75
await MainActor . run { [ newGroup] in
76
76
_group. wrappedValue = newGroup
77
77
}
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ public struct EditProfileView: View {
162
162
do {
163
163
_ = try await ProfileManager . update ( profile)
164
164
#if os(iOS) || os(tvOS)
165
- try await UIProfileUpdateTask . configure ( )
165
+ try UIProfileUpdateTask . configure ( )
166
166
#else
167
167
try await ProfileUpdateTask . configure ( )
168
168
#endif
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ public struct NewProfileView: View {
243
243
) )
244
244
if profileType == . remote {
245
245
#if os(iOS) || os(tvOS)
246
- try await UIProfileUpdateTask . configure ( )
246
+ try UIProfileUpdateTask . configure ( )
247
247
#else
248
248
try await ProfileUpdateTask . configure ( )
249
249
#endif
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Libbox
3
3
import Library
4
4
import SwiftUI
5
5
6
+ @MainActor
6
7
public struct CoreView : View {
7
8
@State private var isLoading = true
8
9
@@ -51,13 +52,17 @@ public struct CoreView: View {
51
52
52
53
private nonisolated func loadSettings( ) async {
53
54
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
+ }
57
60
} else {
58
- version = LibboxVersion ( )
59
- dataSize = " Loading... "
60
- isLoading = false
61
+ await MainActor . run {
62
+ version = LibboxVersion ( )
63
+ dataSize = " Loading... "
64
+ isLoading = false
65
+ }
61
66
await loadSettingsBackground ( )
62
67
}
63
68
}
Original file line number Diff line number Diff line change @@ -85,8 +85,12 @@ public class CommandClient: ObservableObject {
85
85
}
86
86
87
87
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
+ }
90
94
}
91
95
92
96
private nonisolated func connect0( ) async {
@@ -111,7 +115,7 @@ public class CommandClient: ObservableObject {
111
115
case . log:
112
116
clientOptions. statusInterval = Int64 ( 500 * NSEC_PER_MSEC)
113
117
default :
114
- clientOptions. statusInterval = Int64 ( 2 * NSEC_PER_SEC)
118
+ clientOptions. statusInterval = Int64 ( NSEC_PER_SEC)
115
119
}
116
120
let client = LibboxNewCommandClient ( clientHandler ( self ) , clientOptions) !
117
121
do {
You can’t perform that action at this time.
0 commit comments