Skip to content

Commit

Permalink
fix: release build would break
Browse files Browse the repository at this point in the history
in spite of the #if DEBUG
  • Loading branch information
dirtyhenry committed Jul 3, 2024
1 parent 12a74bd commit 390b67f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
17 changes: 0 additions & 17 deletions Sources/Blocks/Transport/TaskState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,6 @@ public enum TaskState: Equatable {
case failed(errorDescription: String)
}

#if DEBUG
extension TaskState {
func debugLoopNextState() -> TaskState {
switch self {
case .notStarted:
.running
case .running:
.completed
case .completed:
.failed(errorDescription: "Dummy error")
case .failed:
.notStarted
}
}
}
#endif

extension TaskState: CustomStringConvertible {
public var description: String {
switch self {
Expand Down
8 changes: 4 additions & 4 deletions Sources/Blocks/UIComponents/TaskStateButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public struct TaskStateButton: View {
runningTitleKey: "Doing this…",
systemImage: "play",
action: {
taskState = taskState.debugLoopNextState()
print("TaskStateButton was tapped")
},
state: taskState
)
Expand All @@ -130,7 +130,7 @@ public struct TaskStateButton: View {
runningTitleKey: "Doing this…",
systemImage: "play",
action: {
taskState = taskState.debugLoopNextState()
print("TaskStateButton was tapped")
},
state: taskState
)
Expand All @@ -148,7 +148,7 @@ public struct TaskStateButton: View {
runningTitleKey: "Doing this…",
systemImage: "play",
action: {
taskState = taskState.debugLoopNextState()
print("TaskStateButton was tapped")
},
state: taskState
)
Expand All @@ -166,7 +166,7 @@ public struct TaskStateButton: View {
runningTitleKey: "Doing this…",
systemImage: "play",
action: {
taskState = taskState.debugLoopNextState()
print("TaskStateButton was tapped")
},
state: taskState,
alignment: .leading
Expand Down

0 comments on commit 390b67f

Please sign in to comment.