Skip to content

Commit

Permalink
Isolate feedback closure and fix completions
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroruizponce committed Nov 12, 2024
1 parent 2706b96 commit 1cd8041
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Sources/Mistica/Components/Feedback/FeedbackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,13 @@ private extension FeedbackView {
primaryButton?.isLoading = true
prepareHapticFeedback()
completion { [weak self] in
self?.prepareAnimation()
self?.startAnimation()

self?.primaryButton?.title = title
self?.primaryButton?.isLoading = false
Task { @MainActor in
self?.prepareAnimation()
self?.startAnimation()

self?.primaryButton?.title = title
self?.primaryButton?.isLoading = false
}
}
case .none:
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import Foundation
import UIKit

public typealias FeedbackCompletion = () -> Void
public typealias FeedbackRetryCompletion = (@escaping () -> Void) -> Void
public typealias FeedbackCompletion = @Sendable () -> Void
public typealias FeedbackRetryCompletion = (@escaping @Sendable () -> Void) -> Void

@frozen
public enum FeedbackPrimaryAction {
Expand Down

0 comments on commit 1cd8041

Please sign in to comment.