From bc7959e1844e19e9fd74563d9950b5849e0f6bd0 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 16 Jan 2024 09:15:09 +0200 Subject: [PATCH] Fixes #2325 - Prevent the same WebView from being reused for multiple Element Call links --- ElementX/Sources/Screens/CallScreen/View/CallScreen.swift | 1 + ElementX/Sources/Screens/Other/GenericCallLinkCoordinator.swift | 1 + changelog.d/2325.bugfix | 1 + 3 files changed, 3 insertions(+) create mode 100644 changelog.d/2325.bugfix diff --git a/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift b/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift index 49e11d4367..6bc8860237 100644 --- a/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift +++ b/ElementX/Sources/Screens/CallScreen/View/CallScreen.swift @@ -23,6 +23,7 @@ struct CallScreen: View { var body: some View { WebView(url: context.viewState.url, viewModelContext: context) + .id(UUID()) .ignoresSafeArea(edges: .bottom) .presentationDragIndicator(.visible) .environment(\.colorScheme, .dark) diff --git a/ElementX/Sources/Screens/Other/GenericCallLinkCoordinator.swift b/ElementX/Sources/Screens/Other/GenericCallLinkCoordinator.swift index 28c0e8a9bc..0239a531a1 100644 --- a/ElementX/Sources/Screens/Other/GenericCallLinkCoordinator.swift +++ b/ElementX/Sources/Screens/Other/GenericCallLinkCoordinator.swift @@ -36,6 +36,7 @@ class GenericCallLinkCoordinator: CoordinatorProtocol { func toPresentable() -> AnyView { AnyView( WebView(url: parameters.url) + .id(UUID()) .ignoresSafeArea(edges: .bottom) .presentationDragIndicator(.visible) ) diff --git a/changelog.d/2325.bugfix b/changelog.d/2325.bugfix new file mode 100644 index 0000000000..b6a525f3a4 --- /dev/null +++ b/changelog.d/2325.bugfix @@ -0,0 +1 @@ +Prevent the same WebView from being reused for multiple Element Call links \ No newline at end of file