Skip to content

Commit 941ddbd

Browse files
authored
Merge pull request #253 from flipperdevices/feature/infrared-promote
[Infrared] Promote Feature
2 parents 3fce93d + cb12160 commit 941ddbd

4 files changed

Lines changed: 18 additions & 11 deletions

File tree

Flipper/Packages/Core/Sources/Model/Router.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ public class Router: ObservableObject {
1010

1111
public init() {
1212
isFirstLaunch = UserDefaultsStorage.shared.isFirstLaunch
13+
14+
// TODO: Find better way
15+
if isFirstLaunch {
16+
UserDefaultsStorage.shared.showInfraredRemoteTab = false
17+
}
1318
}
1419

1520
public func showWelcomeScreen() {

Flipper/Packages/Core/Sources/Storage/Patform/UserDefaultsStorage.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public class UserDefaultsStorage {
2020
@UserDefault(key: .hasReaderLog, defaultValue: false)
2121
public var hasReaderLog: Bool
2222

23+
@UserDefault(key: .showInfraredRemoteTab, defaultValue: true)
24+
public var showInfraredRemoteTab: Bool
25+
2326
// MARK: Debug
2427

2528
@UserDefault(key: .isDebugMode, defaultValue: false)
@@ -96,6 +99,7 @@ public extension UserDefaults {
9699
case hasReaderLog = "hasReaderLog"
97100
case showAppsUpdate = "showAppsUpdate"
98101
case hiddenApps = "hiddenApps"
102+
case showInfraredRemoteTab = "showInfraredRemoteTab"
99103

100104
case isDebugMode = "isDebugMode"
101105
case isSyncingDisabled = "isSyncingDisabled"

Flipper/Packages/UI/Sources/Hub/InfraredLibrary/InfraredLibraryCard.swift

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,15 @@ struct InfraredLibraryCard: View {
1717
}
1818

1919
struct Badge: View {
20-
@Environment(\.colorScheme) var colorScheme
21-
22-
private var color: Color {
23-
switch colorScheme {
24-
case .light: return .black40
25-
default: return .black30
26-
}
27-
}
28-
2920
var body: some View {
3021
Text("Beta")
3122
.font(.system(size: 12))
3223
.padding(.horizontal, 8)
3324
.padding(.vertical, 4)
34-
.foregroundColor(color)
25+
.foregroundColor(.sGreen)
3526
.overlay(
3627
RoundedRectangle(cornerRadius: 30)
37-
.stroke(color, lineWidth: 1)
28+
.stroke(Color.sGreen, lineWidth: 1)
3829
)
3930
.padding(.trailing, 4)
4031
}

Flipper/Packages/UI/Sources/Main/MainView.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct MainView: View {
1010
@StateObject var tabViewController: TabViewController = .init()
1111

1212
@AppStorage(.selectedTab) var selectedTab: TabView.Tab = .device
13+
@AppStorage(.showInfraredRemoteTab) var showInfraredRemoteTab = true
1314

1415
var body: some View {
1516
VStack(spacing: 0) {
@@ -50,5 +51,11 @@ struct MainView: View {
5051
WidgetCenter.shared.reloadTimelines(ofKind: "LiveWidget")
5152
}
5253
}
54+
.onAppear {
55+
if showInfraredRemoteTab {
56+
selectedTab = .hub
57+
showInfraredRemoteTab = false
58+
}
59+
}
5360
}
5461
}

0 commit comments

Comments
 (0)