Skip to content

Commit

Permalink
Merge pull request #7 from crane-hiromu/issue/btn_range
Browse files Browse the repository at this point in the history
update btn range
  • Loading branch information
crane-hiromu authored Dec 22, 2022
2 parents dd81b18 + 2981d4c commit e0e3eba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/DroidKit/View/DroidKitActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ struct DroidKitActionButton: View {
let action: () async throws -> Void

var body: some View {
Button(title) {
Button(action: {
Task {
do {
try await action()
} catch {
debugPrint("fail to \(title): \(error.localizedDescription)")
}
}
}
.modifier(ActionButtonModifier())
}, label: {
Text(title)
.modifier(ActionButtonModifier())
})
}
}

Expand Down

0 comments on commit e0e3eba

Please sign in to comment.