Skip to content

Fix document picker tint colors, remove multi-selection feature flag #4424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ElementX/Sources/Application/Settings/AppSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ protocol CommonSettingsProtocol {
var enableKeyShareOnInvite: Bool { get }
var threadsEnabled: Bool { get }
var hideQuietNotificationAlerts: Bool { get }
var multipleAttachmentUploadEnabled: Bool { get }
}

/// Store Element specific app settings.
Expand Down Expand Up @@ -60,7 +59,6 @@ final class AppSettings {
case knockingEnabled
case threadsEnabled
case developerOptionsEnabled
case multipleAttachmentUploadEnabled

// Doug's tweaks 🔧
case hideUnreadMessagesBadge
Expand Down Expand Up @@ -376,9 +374,6 @@ final class AppSettings {

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

@UserPreference(key: UserDefaultsKeys.multipleAttachmentUploadEnabled, defaultValue: isDevelopmentBuild, storageType: .userDefaults(store))
var multipleAttachmentUploadEnabled
}

extension AppSettings: CommonSettingsProtocol { }
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,6 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
let stackCoordinator = NavigationStackCoordinator()

let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode,
appSettings: appSettings,
userIndicatorController: userIndicatorController,
orientationManager: appMediator.windowManager) { [weak self] action in
guard let self else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ struct DocumentPicker: UIViewControllerRepresentable {
return documentPicker
}

func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) { }
func updateUIViewController(_ uiViewController: UIDocumentPickerViewController, context: Context) {
uiViewController.view.tintColor = .compound.textActionAccent
}

func makeCoordinator() -> Coordinator {
Coordinator(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,19 @@ enum MediaPickerScreenCoordinatorAction {
}

class MediaPickerScreenCoordinator: CoordinatorProtocol {
private let orientationManager: OrientationManagerProtocol
private let userIndicatorController: UserIndicatorControllerProtocol
private let mode: MediaPickerScreenMode
private let userIndicatorController: UserIndicatorControllerProtocol
private let orientationManager: OrientationManagerProtocol
private let callback: (MediaPickerScreenCoordinatorAction) -> Void

init(mode: MediaPickerScreenMode,
appSettings: AppSettings,
userIndicatorController: UserIndicatorControllerProtocol,
orientationManager: OrientationManagerProtocol,
callback: @escaping (MediaPickerScreenCoordinatorAction) -> Void) {
self.mode = mode
self.userIndicatorController = userIndicatorController
self.orientationManager = orientationManager
self.callback = callback

// The users of the media picker chose their ideal selection type leaving
// the feature flag to only be checked and enforced on this level.
self.mode = appSettings.multipleAttachmentUploadEnabled ? mode : .init(source: mode.source, selectionType: .single)
}

func toPresentable() -> AnyView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ struct PhotoLibraryPicker: UIViewControllerRepresentable {
return pickerViewController
}

func updateUIViewController(_ uiViewController: PHPickerViewController, context: Context) { }
func updateUIViewController(_ uiViewController: PHPickerViewController, context: Context) {
uiViewController.view.tintColor = .compound.textActionAccent
}

func makeCoordinator() -> Coordinator {
Coordinator(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ final class RoomDetailsEditScreenCoordinator: CoordinatorProtocol {
let stackCoordinator = NavigationStackCoordinator()

let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode,
appSettings: parameters.appSettings,
userIndicatorController: parameters.userIndicatorController,
orientationManager: parameters.orientationManager) { [weak self] action in
guard let self else { return }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ protocol DeveloperOptionsProtocol: AnyObject {
var enableKeyShareOnInvite: Bool { get set }
var threadsEnabled: Bool { get set }
var hideQuietNotificationAlerts: Bool { get set }
var multipleAttachmentUploadEnabled: Bool { get set }

var hideUnreadMessagesBadge: Bool { get set }
var elementCallBaseURLOverride: URL? { get set }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@ struct DeveloperOptionsScreen: View {
Text("Fuzzy searching")
}
}

Section("Timeline") {
Toggle(isOn: $context.multipleAttachmentUploadEnabled) {
Text("Allow selecting multiple attachments for upload")
}
}


Section("Join rules") {
Toggle(isOn: $context.knockingEnabled) {
Text("Knocking")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ final class UserDetailsEditScreenCoordinator: CoordinatorProtocol {
let stackCoordinator = NavigationStackCoordinator()

let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode,
appSettings: parameters.appSettings,
userIndicatorController: parameters.userIndicatorController,
orientationManager: parameters.orientationManager) { [weak self] action in
guard let self else { return }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ final class StartChatScreenCoordinator: CoordinatorProtocol {
let stackCoordinator = NavigationStackCoordinator()

let mediaPickerCoordinator = MediaPickerScreenCoordinator(mode: mode,
appSettings: parameters.appSettings,
userIndicatorController: parameters.userIndicatorController,
orientationManager: parameters.orientationManager) { [weak self] action in
guard let self else { return }
Expand Down
Loading