From 0443d5e5a437f9d8e16d1bcdc7c2ecd95056985d Mon Sep 17 00:00:00 2001 From: Programistich Date: Mon, 2 Dec 2024 22:15:13 +0200 Subject: [PATCH] Rename --- Flipper/Packages/Core/Sources/Model/Emulate.swift | 6 +++--- Flipper/iOS/UI/Archive/Emulate/InfraredEmulateView.swift | 6 +++--- .../Infrared/Components/InfraredEmulateActionModifier.swift | 2 +- .../Environment/Environment+InfraredEmulateAction.swift | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Flipper/Packages/Core/Sources/Model/Emulate.swift b/Flipper/Packages/Core/Sources/Model/Emulate.swift index 60d62922..66a182d7 100644 --- a/Flipper/Packages/Core/Sources/Model/Emulate.swift +++ b/Flipper/Packages/Core/Sources/Model/Emulate.swift @@ -25,7 +25,7 @@ public class Emulate: ObservableObject { } public enum EmulateType { - case infinite + case continuous case single } @@ -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 @@ -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) diff --git a/Flipper/iOS/UI/Archive/Emulate/InfraredEmulateView.swift b/Flipper/iOS/UI/Archive/Emulate/InfraredEmulateView.swift index eca619fe..672608d0 100644 --- a/Flipper/iOS/UI/Archive/Emulate/InfraredEmulateView.swift +++ b/Flipper/iOS/UI/Archive/Emulate/InfraredEmulateView.swift @@ -155,7 +155,7 @@ struct InfraredEmulateView: View { if currentEmulateIndex == index { forceStopEmulate() } else { - startEmulate(index: index, type: .infinite) + startEmulate(index: index, type: .continuous) } } @@ -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() } } diff --git a/Flipper/iOS/UI/Infrared/Components/InfraredEmulateActionModifier.swift b/Flipper/iOS/UI/Infrared/Components/InfraredEmulateActionModifier.swift index 43cf6d74..479ca263 100644 --- a/Flipper/iOS/UI/Infrared/Components/InfraredEmulateActionModifier.swift +++ b/Flipper/iOS/UI/Infrared/Components/InfraredEmulateActionModifier.swift @@ -22,7 +22,7 @@ private struct EmulateActionModifier: ViewModifier { } func onPress() { - action(keyID, Emulate.EmulateType.infinite) + action(keyID, Emulate.EmulateType.continuous) } func onRelease() { diff --git a/Flipper/iOS/UI/Infrared/Environment/Environment+InfraredEmulateAction.swift b/Flipper/iOS/UI/Infrared/Environment/Environment+InfraredEmulateAction.swift index 5e2f039d..707af896 100644 --- a/Flipper/iOS/UI/Infrared/Environment/Environment+InfraredEmulateAction.swift +++ b/Flipper/iOS/UI/Infrared/Environment/Environment+InfraredEmulateAction.swift @@ -3,6 +3,7 @@ import SwiftUI extension EnvironmentValues { @Entry var emulateAction: ( - InfraredKeyID, Emulate.EmulateType + InfraredKeyID, + Emulate.EmulateType ) -> Void = { _, _ in } }