mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
EC: handle back navigation from the webview
EC: remove native header updated element call to 0.13.0-rc1
This commit is contained in:
@@ -8764,7 +8764,7 @@
|
|||||||
repositoryURL = "https://github.com/element-hq/element-call-swift";
|
repositoryURL = "https://github.com/element-hq/element-call-swift";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = exactVersion;
|
kind = exactVersion;
|
||||||
version = 0.12.2;
|
version = "0.13.0-rc.1";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {
|
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {
|
||||||
|
|||||||
@@ -59,8 +59,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/element-hq/element-call-swift",
|
"location" : "https://github.com/element-hq/element-call-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "46e04acd94d139223364806063eda083f17007d0",
|
"revision" : "b3ceeddf59652a0806c008858ef9885bdd924d4c",
|
||||||
"version" : "0.12.2"
|
"version" : "0.13.0-rc.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ enum CallScreenJavaScriptMessageName: String, CaseIterable {
|
|||||||
case showNativeOutputDevicePicker
|
case showNativeOutputDevicePicker
|
||||||
/// Used to determine if the webview has selected the earpiece or not.
|
/// Used to determine if the webview has selected the earpiece or not.
|
||||||
case onOutputDeviceSelect
|
case onOutputDeviceSelect
|
||||||
|
/// Used to handle the webview back button
|
||||||
|
case onBackButtonPressed
|
||||||
|
|
||||||
private var postMessageScript: String {
|
private var postMessageScript: String {
|
||||||
switch self {
|
switch self {
|
||||||
@@ -87,6 +89,12 @@ enum CallScreenJavaScriptMessageName: String, CaseIterable {
|
|||||||
window.webkit.messageHandlers.\(rawValue).postMessage(id);
|
window.webkit.messageHandlers.\(rawValue).postMessage(id);
|
||||||
};
|
};
|
||||||
"""
|
"""
|
||||||
|
case .onBackButtonPressed:
|
||||||
|
"""
|
||||||
|
window.controls.\(rawValue) = () => {
|
||||||
|
window.webkit.messageHandlers.\(rawValue).postMessage("");
|
||||||
|
}
|
||||||
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
|
|||||||
setupCall()
|
setupCall()
|
||||||
|
|
||||||
timeoutTask = Task { [weak self] in
|
timeoutTask = Task { [weak self] in
|
||||||
try? await Task.sleep(for: .seconds(30))
|
try? await Task.sleep(for: .seconds(10))
|
||||||
guard !Task.isCancelled, let self else { return }
|
guard !Task.isCancelled, let self else { return }
|
||||||
MXLog.error("Failed to join Element Call: Timeout")
|
MXLog.error("Failed to join Element Call: Timeout")
|
||||||
state.bindings.alertInfo = .init(id: UUID(),
|
state.bindings.alertInfo = .init(id: UUID(),
|
||||||
|
|||||||
@@ -16,21 +16,10 @@ struct CallScreen: View {
|
|||||||
@ObservedObject var context: CallScreenViewModel.Context
|
@ObservedObject var context: CallScreenViewModel.Context
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
content
|
||||||
content
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
.alert(item: $context.alertInfo)
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
|
||||||
.toolbar {
|
|
||||||
ToolbarItem(placement: .cancellationAction) {
|
|
||||||
Button { context.send(viewAction: .navigateBack) } label: {
|
|
||||||
Image(systemSymbol: .chevronBackward)
|
|
||||||
.fontWeight(.semibold)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.alert(item: $context.alertInfo)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
@@ -185,6 +174,8 @@ private struct CallView: UIViewRepresentable {
|
|||||||
case .onOutputDeviceSelect:
|
case .onOutputDeviceSelect:
|
||||||
guard let deviceID = message.body as? String else { return }
|
guard let deviceID = message.body as? String else { return }
|
||||||
viewModelContext?.send(viewAction: .outputDeviceSelected(deviceID: deviceID))
|
viewModelContext?.send(viewAction: .outputDeviceSelected(deviceID: deviceID))
|
||||||
|
case .onBackButtonPressed:
|
||||||
|
viewModelContext?.send(viewAction: .navigateBack)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,8 +345,6 @@ struct CallScreen_Previews: PreviewProvider {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
NavigationStack {
|
CallScreen(context: viewModel.context)
|
||||||
CallScreen(context: viewModel.context)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
|
|||||||
widgetId: widgetID,
|
widgetId: widgetID,
|
||||||
parentUrl: nil,
|
parentUrl: nil,
|
||||||
header: .appBar,
|
header: .appBar,
|
||||||
hideHeader: nil,
|
hideHeader: true,
|
||||||
preload: nil,
|
preload: nil,
|
||||||
fontScale: nil,
|
fontScale: nil,
|
||||||
appPrompt: false,
|
appPrompt: false,
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ packages:
|
|||||||
# path: ../matrix-analytics-events
|
# path: ../matrix-analytics-events
|
||||||
EmbeddedElementCall:
|
EmbeddedElementCall:
|
||||||
url: https://github.com/element-hq/element-call-swift
|
url: https://github.com/element-hq/element-call-swift
|
||||||
exactVersion: 0.12.2
|
exactVersion: 0.13.0-rc.1
|
||||||
Emojibase:
|
Emojibase:
|
||||||
url: https://github.com/matrix-org/emojibase-bindings
|
url: https://github.com/matrix-org/emojibase-bindings
|
||||||
minorVersion: 1.4.2
|
minorVersion: 1.4.2
|
||||||
|
|||||||
Reference in New Issue
Block a user