* refactored the static location screen to the location sharing screen # Conflicts: # UnitTests/Sources/LocationSharingScreenViewModelTests.swift # Conflicts: # ElementX.xcodeproj/project.pbxproj * implemented a custom pin with an overlayable view * implemented the render of the user when the location is sender instead of the pin type * removed description and body they are not used at all. * reimplemented single button for sharing this or user location + implemented an experimental way to update annotations * removed unnecessary @Suite description * implemented a way to display the alert on top of the sheet and added a spinner to the center user location button * fixed alerts strings * fixed a failing test * improved preview tests
75 lines
2.1 KiB
Swift
75 lines
2.1 KiB
Swift
//
|
|
// Copyright 2025 Element Creations Ltd.
|
|
// Copyright 2022-2025 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum DeveloperOptionsScreenViewModelAction {
|
|
case clearCache
|
|
}
|
|
|
|
struct DeveloperOptionsScreenViewState: BindableState {
|
|
let elementCallBaseURL: URL
|
|
let appHooks: AppHooks
|
|
var storeSizes: [StoreSize]?
|
|
var bindings: DeveloperOptionsScreenViewStateBindings
|
|
|
|
struct StoreSize: Identifiable {
|
|
let name: String
|
|
let size: String
|
|
|
|
var id: String {
|
|
name + size
|
|
}
|
|
}
|
|
}
|
|
|
|
// periphery: ignore - subscripts are seen as false positive
|
|
@dynamicMemberLookup
|
|
struct DeveloperOptionsScreenViewStateBindings {
|
|
private let developerOptions: DeveloperOptionsProtocol
|
|
|
|
init(developerOptions: DeveloperOptionsProtocol) {
|
|
self.developerOptions = developerOptions
|
|
}
|
|
|
|
subscript<Setting>(dynamicMember keyPath: ReferenceWritableKeyPath<DeveloperOptionsProtocol, Setting>) -> Setting {
|
|
get { developerOptions[keyPath: keyPath] }
|
|
set { developerOptions[keyPath: keyPath] = newValue }
|
|
}
|
|
}
|
|
|
|
enum DeveloperOptionsScreenViewAction {
|
|
case clearCache
|
|
}
|
|
|
|
protocol DeveloperOptionsProtocol: AnyObject {
|
|
var logLevel: LogLevel { get set }
|
|
var traceLogPacks: Set<TraceLogPack> { get set }
|
|
|
|
var enableOnlySignedDeviceIsolationMode: Bool { get set }
|
|
var enableKeyShareOnInvite: Bool { get set }
|
|
var hideQuietNotificationAlerts: Bool { get set }
|
|
var focusEventOnNotificationTap: Bool { get set }
|
|
|
|
var hideUnreadMessagesBadge: Bool { get set }
|
|
var elementCallBaseURLOverride: URL? { get set }
|
|
|
|
var publicSearchEnabled: Bool { get set }
|
|
var fuzzyRoomListSearchEnabled: Bool { get set }
|
|
var lowPriorityFilterEnabled: Bool { get set }
|
|
var knockingEnabled: Bool { get set }
|
|
|
|
var linkPreviewsEnabled: Bool { get set }
|
|
|
|
var linkNewDeviceEnabled: Bool { get set }
|
|
|
|
var liveLocationSharingEnabled: Bool { get set }
|
|
}
|
|
|
|
extension AppSettings: DeveloperOptionsProtocol { }
|