Skip to content

Commit

Permalink
Fix concurrency errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Sep 25, 2024
1 parent a504413 commit 88e7fc4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/SpeziViews/Views/Button/AsyncButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public struct AsyncButton<Label: View>: View {
public init(
_ title: LocalizedStringResource,
role: ButtonRole? = nil,
action: @escaping () async -> Void
action: @MainActor @escaping () async -> Void
) where Label == Text {
self.init(role: role, action: action) {
Text(title)
Expand All @@ -91,7 +91,7 @@ public struct AsyncButton<Label: View>: View {
public init<Title: StringProtocol>(
_ title: Title,
role: ButtonRole? = nil,
action: @escaping () async -> Void
action: @MainActor @escaping () async -> Void
) where Label == Text {
self.init(role: role, action: action) {
Text(verbatim: String(title))
Expand All @@ -105,7 +105,7 @@ public struct AsyncButton<Label: View>: View {
/// - label: The Button label.
public init(
role: ButtonRole? = nil,
action: @escaping () async -> Void,
action: @MainActor @escaping () async -> Void,
@ViewBuilder label: () -> Label
) {
self.role = role
Expand All @@ -126,7 +126,7 @@ public struct AsyncButton<Label: View>: View {
_ title: Title,
role: ButtonRole? = nil,
state: Binding<ViewState>,
action: @escaping () async throws -> Void
action: @MainActor @escaping () async throws -> Void
) where Label == Text {
self.init(role: role, state: state, action: action) {
Text(verbatim: String(title))
Expand All @@ -144,7 +144,7 @@ public struct AsyncButton<Label: View>: View {
_ title: LocalizedStringResource,
role: ButtonRole? = nil,
state: Binding<ViewState>,
action: @escaping () async throws -> Void
action: @MainActor @escaping () async throws -> Void
) where Label == Text {
self.init(role: role, state: state, action: action) {
Text(title)
Expand All @@ -161,7 +161,7 @@ public struct AsyncButton<Label: View>: View {
public init( // swiftlint:disable:this function_default_parameter_at_end
role: ButtonRole? = nil,
state: Binding<ViewState>,
action: @escaping () async throws -> Void,
action: @MainActor @escaping () async throws -> Void,
@ViewBuilder label: () -> Label
) {
self.role = role
Expand Down

0 comments on commit 88e7fc4

Please sign in to comment.