Skip to content

Commit

Permalink
Removed IssueReporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean151 committed Aug 14, 2024
1 parent 2ec1b3d commit d567519
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions Sources/ButtonKit/Trigger/Trigger+Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@
// SOFTWARE.
//

import SwiftUI

#if canImport(IssueReporting)
import IssueReporting
#else
import OSLog
#endif
import SwiftUI

/// Allow to trigger an arbitrary but identified `AsyncButton` or `ThrowableButton`
public final class TriggerButton: Sendable {
Expand All @@ -42,11 +37,7 @@ public final class TriggerButton: Sendable {
@MainActor
public func callAsFunction(id: AnyHashable) {
guard let closure = buttons[id] else {
#if canImport(IssueReporting)
reportIssue("Could not trigger button with id: \(id). It is not currently on screen!")
#else
Logger(subsystem: "ButtonKit", category: "Trigger").warning("Could not trigger button with id: \(id). It is not currently on screen!")
#endif
return
}
closure()
Expand All @@ -55,11 +46,7 @@ public final class TriggerButton: Sendable {
@MainActor
func register(id: AnyHashable, action: @escaping @MainActor () -> Void) {
if buttons.keys.contains(id) {
#if canImport(IssueReporting)
reportIssue("Registering a button with an already existing id: \(id). The previous one was overridden.")
#else
Logger(subsystem: "ButtonKit", category: "Trigger").warning("Registering a button with an already existing id: \(id). The previous one was overridden.")
#endif
}
buttons.updateValue(action, forKey: id)
}
Expand Down

0 comments on commit d567519

Please sign in to comment.