mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Removing Dead Code part 1 (#2234)
This commit is contained in:
@@ -31,6 +31,18 @@ extension View {
|
||||
})
|
||||
return alert(item.wrappedValue?.title ?? "", isPresented: binding, presenting: item.wrappedValue, actions: actions, message: message)
|
||||
}
|
||||
|
||||
// periphery: ignore - not used yet but might be useful
|
||||
func alert<Item, Actions>(item: Binding<Item?>, @ViewBuilder actions: (Item) -> Actions) -> some View where Item: AlertProtocol, Actions: View {
|
||||
let binding = Binding<Bool>(get: {
|
||||
item.wrappedValue != nil
|
||||
}, set: { newValue in
|
||||
if !newValue {
|
||||
item.wrappedValue = nil
|
||||
}
|
||||
})
|
||||
return alert(item.wrappedValue?.title ?? "", isPresented: binding, presenting: item.wrappedValue, actions: actions)
|
||||
}
|
||||
}
|
||||
|
||||
/// A type that describes an alert to be shown to the user.
|
||||
|
||||
@@ -73,13 +73,3 @@ extension Array where Element == RoomTimelineItemProtocol {
|
||||
first { $0.id.timelineID == id.timelineID }
|
||||
}
|
||||
}
|
||||
|
||||
extension Array {
|
||||
func appending(_ element: Element) -> [Element] {
|
||||
self + [element]
|
||||
}
|
||||
|
||||
func appending(_ elements: [Element]) -> [Element] {
|
||||
self + elements
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ extension View {
|
||||
return confirmationDialog(item.wrappedValue?.title ?? "", isPresented: binding, titleVisibility: titleVisibility, presenting: item.wrappedValue, actions: actions)
|
||||
}
|
||||
|
||||
// periphery: ignore - not used yet but might be useful
|
||||
func confirmationDialog<Item, Actions, Message>(item: Binding<Item?>,
|
||||
titleVisibility: Visibility = .automatic,
|
||||
@ViewBuilder actions: (Item) -> Actions,
|
||||
|
||||
@@ -21,9 +21,3 @@ extension MapTilerStyleBuilder {
|
||||
self.init(baseURL: appSettings.mapTilerBaseURL, key: appSettings.mapTilerApiKey)
|
||||
}
|
||||
}
|
||||
|
||||
extension MapTilerGeoCodingService {
|
||||
init(session: URLSession = .shared, appSettings: AppSettings) {
|
||||
self.init(session: session, key: appSettings.mapTilerApiKey, geocodingURL: appSettings.geocodingURLFormatString)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user