Skip to content

Commit

Permalink
Remove the Element Call Picture in Picture feature flag. (#3204)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave authored Aug 27, 2024
1 parent 812c5d5 commit 61df1dd
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ElementX/Sources/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg

let callScreenCoordinator = CallScreenCoordinator(parameters: .init(elementCallService: elementCallService,
configuration: configuration,
elementCallPictureInPictureEnabled: false,
allowPictureInPicture: false,
appHooks: appHooks))

callScreenCoordinator.actions
Expand Down
4 changes: 0 additions & 4 deletions ElementX/Sources/Application/AppSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ final class AppSettings {
case publicSearchEnabled
case fuzzyRoomListSearchEnabled
case pinningEnabled
case elementCallPictureInPictureEnabled
}

private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier
Expand Down Expand Up @@ -285,9 +284,6 @@ final class AppSettings {

@UserPreference(key: UserDefaultsKeys.pinningEnabled, defaultValue: false, storageType: .userDefaults(store))
var pinningEnabled

@UserPreference(key: UserDefaultsKeys.elementCallPictureInPictureEnabled, defaultValue: false, storageType: .userDefaults(store))
var elementCallPictureInPictureEnabled

#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {

let callScreenCoordinator = CallScreenCoordinator(parameters: .init(elementCallService: elementCallService,
configuration: configuration,
elementCallPictureInPictureEnabled: appSettings.elementCallPictureInPictureEnabled,
allowPictureInPicture: true,
appHooks: appHooks))

callScreenCoordinator.actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SwiftUI
struct CallScreenCoordinatorParameters {
let elementCallService: ElementCallServiceProtocol
let configuration: ElementCallConfiguration
let elementCallPictureInPictureEnabled: Bool
let allowPictureInPicture: Bool
let appHooks: AppHooks
}

Expand All @@ -46,7 +46,7 @@ final class CallScreenCoordinator: CoordinatorProtocol {
init(parameters: CallScreenCoordinatorParameters) {
viewModel = CallScreenViewModel(elementCallService: parameters.elementCallService,
configuration: parameters.configuration,
elementCallPictureInPictureEnabled: parameters.elementCallPictureInPictureEnabled,
allowPictureInPicture: parameters.allowPictureInPicture,
appHooks: parameters.appHooks)
}

Expand Down
8 changes: 4 additions & 4 deletions ElementX/Sources/Screens/CallScreen/CallScreenViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ typealias CallScreenViewModelType = StateStoreViewModel<CallScreenViewState, Cal
class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol {
private let elementCallService: ElementCallServiceProtocol
private let configuration: ElementCallConfiguration
private let isPictureInPictureEnabled: Bool
private let isPictureInPictureAllowed: Bool

private let widgetDriver: ElementCallWidgetDriverProtocol

Expand All @@ -43,11 +43,11 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
/// - clientID: Something to identify the current client on the Element Call side
init(elementCallService: ElementCallServiceProtocol,
configuration: ElementCallConfiguration,
elementCallPictureInPictureEnabled: Bool,
allowPictureInPicture: Bool,
appHooks: AppHooks) {
self.elementCallService = elementCallService
self.configuration = configuration
isPictureInPictureEnabled = elementCallPictureInPictureEnabled
isPictureInPictureAllowed = allowPictureInPicture

switch configuration.kind {
case .genericCallLink(let url):
Expand Down Expand Up @@ -189,7 +189,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol

private func handleBackwardsNavigation() async {
guard state.url != nil,
isPictureInPictureEnabled,
isPictureInPictureAllowed,
let requestPictureInPictureHandler = state.bindings.requestPictureInPictureHandler else {
actionsSubject.send(.dismiss)
return
Expand Down
2 changes: 1 addition & 1 deletion ElementX/Sources/Screens/CallScreen/View/CallScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ struct CallScreen_Previews: PreviewProvider {
elementCallBaseURL: "https://call.element.io",
elementCallBaseURLOverride: nil,
colorScheme: .light),
elementCallPictureInPictureEnabled: false,
allowPictureInPicture: false,
appHooks: AppHooks())
}()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ protocol DeveloperOptionsProtocol: AnyObject {
var elementCallBaseURLOverride: URL? { get set }
var fuzzyRoomListSearchEnabled: Bool { get set }
var pinningEnabled: Bool { get set }
var elementCallPictureInPictureEnabled: Bool { get set }
}

extension AppSettings: DeveloperOptionsProtocol { }
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ struct DeveloperOptionsScreen: View {
context.elementCallBaseURLOverride = url
}
}

Toggle(isOn: $context.elementCallPictureInPictureEnabled) {
Text("Picture in Picture support")
Text("Requires an Element Call deployment with support for signalling PiP availability.")
}
} header: {
Text("Element Call")
} footer: {
Expand Down

0 comments on commit 61df1dd

Please sign in to comment.