From b2d18f69604fd54e6a50499dc3188a1dda44bf4e Mon Sep 17 00:00:00 2001 From: Arturs Krumins Date: Tue, 20 Aug 2024 15:54:52 +0300 Subject: [PATCH] ios: fix visual artifacts when opening a chat on iOS15 (#4726) * ios: fix visual artifacts when opening a chat on iOS15 * fix separators * cleanup --- .../Shared/Views/ChatList/ChatListView.swift | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/ios/Shared/Views/ChatList/ChatListView.swift b/apps/ios/Shared/Views/ChatList/ChatListView.swift index 041b45492d..8ad03236f1 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListView.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListView.swift @@ -217,14 +217,31 @@ struct ChatListView: View { .listRowSeparator(.hidden) .listRowBackground(Color.clear) } - ForEach(cs, id: \.viewId) { chat in - ChatListNavLink(chat: chat) + if #available(iOS 16.0, *) { + ForEach(cs, id: \.viewId) { chat in + ChatListNavLink(chat: chat) + .scaleEffect(x: 1, y: oneHandUI ? -1 : 1, anchor: .center) + .padding(.trailing, -16) + .disabled(chatModel.chatRunning != true || chatModel.deletedChats.contains(chat.chatInfo.id)) + .listRowBackground(Color.clear) + } + .offset(x: -8) + } else { + ForEach(cs, id: \.viewId) { chat in + VStack(spacing: .zero) { + Divider() + .padding(.leading, 16) + ChatListNavLink(chat: chat) + .padding(.horizontal, 8) + .padding(.vertical, 6) + } .scaleEffect(x: 1, y: oneHandUI ? -1 : 1, anchor: .center) - .padding(.trailing, -16) + .listRowSeparator(.hidden) + .listRowInsets(EdgeInsets()) + .background { theme.colors.background } // Hides default list selection colour .disabled(chatModel.chatRunning != true || chatModel.deletedChats.contains(chat.chatInfo.id)) - .listRowBackground(Color.clear) + } } - .offset(x: -8) } .listStyle(.plain) .onChange(of: chatModel.chatId) { currentChatId in