From 927ef5fbbcf49988a894803fb552b21bcbac1175 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Wed, 23 Jul 2025 10:34:38 +0200 Subject: [PATCH] Remove static sharedCoordinator from UIList and ensure a new Coordinator is created for every instance --- .../UI/Main/Conversations/Fragments/UIList.swift | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Linphone/UI/Main/Conversations/Fragments/UIList.swift b/Linphone/UI/Main/Conversations/Fragments/UIList.swift index e7040c5d3..667dc886a 100644 --- a/Linphone/UI/Main/Conversations/Fragments/UIList.swift +++ b/Linphone/UI/Main/Conversations/Fragments/UIList.swift @@ -100,8 +100,6 @@ class FloatingButton: UIButton { struct UIList: UIViewRepresentable { - private static var sharedCoordinator: Coordinator? - @StateObject private var viewModel = ChatViewModel() @StateObject private var paginationState = PaginationState() @@ -346,14 +344,11 @@ struct UIList: UIViewRepresentable { // MARK: - Coordinator func makeCoordinator() -> Coordinator { - if UIList.sharedCoordinator == nil { - UIList.sharedCoordinator = Coordinator( - parent: self, - geometryProxy: geometryProxy, - sections: sections - ) - } - return UIList.sharedCoordinator! + Coordinator( + parent: self, + geometryProxy: geometryProxy, + sections: sections + ) } class Coordinator: NSObject, UITableViewDataSource, UITableViewDelegate {