Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Programistich committed Dec 2, 2024
1 parent 22f615f commit 0443d5e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Flipper/Packages/Core/Sources/Model/Emulate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Emulate: ObservableObject {
}

public enum EmulateType {
case infinite
case continuous
case single
}

Expand Down Expand Up @@ -68,7 +68,7 @@ public class Emulate: ObservableObject {
public func startEmulate(
_ item: ArchiveItem,
config: EmulateConfig = .none,
type: EmulateType = .infinite
type: EmulateType = .continuous
) {
guard self.item == nil else {
return
Expand Down Expand Up @@ -171,7 +171,7 @@ public class Emulate: ObservableObject {
{
do {
switch type {
case .infinite:
case .continuous:
try await application.buttonPress(index: index)
case .single:
try await application.buttonPressRelease(index: index)
Expand Down
6 changes: 3 additions & 3 deletions Flipper/iOS/UI/Archive/Emulate/InfraredEmulateView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ struct InfraredEmulateView: View {
if currentEmulateIndex == index {
forceStopEmulate()
} else {
startEmulate(index: index, type: .infinite)
startEmulate(index: index, type: .continuous)
}
}

Expand All @@ -166,9 +166,9 @@ struct InfraredEmulateView: View {
guard let flipper = device.flipper else { return }

if flipper.hasSingleEmulateSupport {
startEmulate(index: index, type: .infinite)
} else {
startEmulate(index: index, type: .single)
} else {
startEmulate(index: index, type: .continuous)
stopEmulate()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private struct EmulateActionModifier: ViewModifier {
}

func onPress() {
action(keyID, Emulate.EmulateType.infinite)
action(keyID, Emulate.EmulateType.continuous)
}

func onRelease() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import SwiftUI

extension EnvironmentValues {
@Entry var emulateAction: (
InfraredKeyID, Emulate.EmulateType
InfraredKeyID,
Emulate.EmulateType
) -> Void = { _, _ in }
}

0 comments on commit 0443d5e

Please sign in to comment.