Skip to content

Commit

Permalink
chore(ios): clean up sharing feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
autoreleasefool committed Sep 9, 2024
1 parent 47c5949 commit 29ec98a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 29 deletions.
6 changes: 0 additions & 6 deletions ios/Approach/Sources/FeatureFlagsLibrary/FeatureFlags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ extension FeatureFlag {
public static let developerOptions = Self(name: "developerOptions", introduced: "2022-11-10", stage: .development, isOverridable: false)
public static let teams = Self(name: "teams", introduced: "2023-01-03", stage: .development)
public static let opponentDetails = Self(name: "opponentDetails", introduced: "2023-08-18", stage: .development)
public static let sharingGame = Self(name: "sharingGame", introduced: "2023-08-29", stage: .release)
public static let sharingSeries = Self(name: "sharingSeries", introduced: "2023-08-29", stage: .release)
public static let alleyAndGearAverages = Self(name: "alleyAndGearAverages", introduced: "2023-09-12", stage: .development)
public static let proSubscription = Self(name: "proSubscription", introduced: "2023-08-08", stage: .development)
public static let purchases = Self(name: "purchase", introduced: "2023-09-15", stage: .disabled)
public static let dataImport = Self(name: "dataImport", introduced: "2023-09-17", stage: .release)
public static let sharingStatistic = Self(name: "sharingStatistic", introduced: "2024-04-27", stage: .release)
public static let photoAvatars = Self(name: "photoAvatars", introduced: "2024-07-05", stage: .development)
public static let bowlerDetails = Self(name: "bowlerDetails", introduced: "2024-07-05", stage: .development)
public static let highestScorePossible = Self(name: "highestScorePossible", introduced: "2024-08-14", stage: .development)
Expand All @@ -27,9 +24,6 @@ extension FeatureFlag {
.photoAvatars,
.proSubscription,
.purchases,
.sharingGame,
.sharingSeries,
.sharingStatistic,
.teams,
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import AnalyticsServiceInterface
import AssetsLibrary
import ComposableArchitecture
import FeatureActionLibrary
import FeatureFlagsLibrary
import ModelsLibrary
import PreferenceServiceInterface
import StringsLibrary
Expand All @@ -14,15 +13,11 @@ public struct GamesHeader: Reducer, Sendable {
@ObservableState
public struct State: Equatable {
public var currentGameIndex: Int = 0
public let isSharingGameEnabled: Bool
public var shimmerColor: Color?

public var isFlashEditorChangesEnabled: Bool

init() {
@Dependency(\.featureFlags) var featureFlags
self.isSharingGameEnabled = featureFlags.isFlagEnabled(.sharingGame)

@Dependency(\.preferences) var preferences
self.isFlashEditorChangesEnabled = preferences.bool(forKey: .gameShouldNotifyEditorChanges) ?? true
}
Expand Down Expand Up @@ -145,9 +140,7 @@ public struct GamesHeaderView: View {

Spacer()

if store.isSharingGameEnabled {
headerButton(systemSymbol: .squareAndArrowUp) { send(.didTapShareButton) }
}
headerButton(systemSymbol: .squareAndArrowUp) { send(.didTapShareButton) }

headerButton(systemSymbol: .gear) { send(.didTapSettingsButton) }
}
Expand Down
4 changes: 0 additions & 4 deletions ios/Approach/Sources/GamesListFeature/GamesList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ComposableArchitecture
import EquatablePackageLibrary
import ErrorsFeature
import FeatureActionLibrary
import FeatureFlagsLibrary
import Foundation
import GamesEditorFeature
import GamesRepositoryInterface
Expand Down Expand Up @@ -52,9 +51,6 @@ public struct GamesList: Reducer, Sendable {
)
)

@Dependency(\.featureFlags) var featureFlags
self.isSeriesSharingEnabled = featureFlags.isFlagEnabled(.sharingSeries)

@Dependency(TipsService.self) var tips
self.isShowingArchiveTip = tips.shouldShow(tipFor: .gameArchiveTip)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import AnalyticsServiceInterface
import ComposableArchitecture
import ErrorsFeature
import FeatureActionLibrary
import FeatureFlagsLibrary
import FeatureFlagsPackageServiceInterface
import NotificationsServiceInterface
import PreferenceServiceInterface
import RecentlyUsedServiceInterface
Expand Down Expand Up @@ -40,8 +38,6 @@ public struct StatisticsDetails: Reducer, Sendable {

public var charts: StatisticsDetailsCharts.State

public let isSharingStatisticsEnabled: Bool

@Presents public var destination: Destination.State?

var filterViewSize: StatisticsFilterView.Size {
Expand All @@ -65,9 +61,6 @@ public struct StatisticsDetails: Reducer, Sendable {

@Dependency(\.date) var date
self.willAdjustLaneLayoutAt = date()

@Dependency(\.featureFlags) var featureFlags
self.isSharingStatisticsEnabled = featureFlags.isFlagEnabled(.sharingStatistic)
}

mutating func syncChartsSharedState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ public struct StatisticsDetailsView: View {
.navigationTitle(store.sources?.bowler.name ?? "")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
if store.isSharingStatisticsEnabled {
ToolbarItem(placement: .navigationBarTrailing) {
ShareButton { send(.didTapShareButton) }
}
ToolbarItem(placement: .navigationBarTrailing) {
ShareButton { send(.didTapShareButton) }
}

ToolbarItem(placement: .navigationBarTrailing) {
Expand Down

0 comments on commit 29ec98a

Please sign in to comment.