From ea1beda6d6d9ede4a066fc060eeccc219e2e0e30 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 49e11d436..6bc886023 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 28c0e8a9b..0239a531a 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 000000000..b6a525f3a --- /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