Skip to content

Commit 72c3edf

Browse files
committed
Format code according to swiftformat
1 parent 6d6f4e0 commit 72c3edf

File tree

10 files changed

+39
-38
lines changed

10 files changed

+39
-38
lines changed

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListView.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
8181
view.navigationViewStyle(.stack)
8282
})
8383
.background(
84-
isIphone && handleTabBarVisibility ?
85-
Color.clear.background(
86-
TabBarAccessor { tabBar in
87-
self.tabBar = tabBar
88-
}
89-
)
90-
.allowsHitTesting(false)
91-
: nil
92-
)
93-
.onReceive(viewModel.$hideTabBar) { newValue in
94-
if isIphone && handleTabBarVisibility {
95-
self.setupTabBarAppeareance()
96-
self.tabBar?.isHidden = newValue
97-
}
98-
}
99-
.accessibilityIdentifier("ChatChannelListView")
84+
isIphone && handleTabBarVisibility ?
85+
Color.clear.background(
86+
TabBarAccessor { tabBar in
87+
self.tabBar = tabBar
88+
}
89+
)
90+
.allowsHitTesting(false)
91+
: nil
92+
)
93+
.onReceive(viewModel.$hideTabBar) { newValue in
94+
if isIphone && handleTabBarVisibility {
95+
self.setupTabBarAppeareance()
96+
self.tabBar?.isHidden = newValue
97+
}
98+
}
99+
.accessibilityIdentifier("ChatChannelListView")
100100
}
101101

102102
@ViewBuilder

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadList.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
3535
self.factory = factory
3636
self.threads = threads
3737
self.threadDestination = threadDestination
38-
self._selectedThread = selectedThread
38+
_selectedThread = selectedThread
3939
self.onItemTap = onItemTap
4040
self.onItemAppear = onItemAppear
4141
self.headerView = headerView
@@ -49,7 +49,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
4949
factory: factory,
5050
threads: threads,
5151
threadDestination: threadDestination,
52-
selectedThread: $selectedThread,
52+
selectedThread: $selectedThread,
5353
onItemTap: onItemTap,
5454
onItemAppear: onItemAppear
5555
)
@@ -82,7 +82,7 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
8282
self.threadDestination = threadDestination
8383
self.onItemTap = onItemTap
8484
self.onItemAppear = onItemAppear
85-
self._selectedThread = selectedThread
85+
_selectedThread = selectedThread
8686
}
8787

8888
public var body: some View {
@@ -93,9 +93,11 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
9393
threadDestination: threadDestination,
9494
selectedThread: $selectedThread
9595
)
96-
.background(factory.makeThreadListItemBackground(
97-
thread: thread,
98-
isSelected: selectedThread?.id == thread.id)
96+
.background(
97+
factory.makeThreadListItemBackground(
98+
thread: thread,
99+
isSelected: selectedThread?.id == thread.id
100+
)
99101
)
100102
.contentShape(Rectangle())
101103
.onTapGesture {

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public struct ChatThreadListItemViewModel {
5151
parentMessageText = threadTitle
5252
} else {
5353
let formatter = InjectedValues[\.utils].messagePreviewFormatter
54-
parentMessageText = formatter.formatContent(for: thread.parentMessage)
54+
parentMessageText = formatter.formatContent(for: thread.parentMessage)
5555
}
5656
return L10n.Thread.Item.repliedTo(parentMessageText.trimmed)
5757
}

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListNavigatableItem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct ChatThreadListNavigatableItem<ThreadListItem: View, ThreadDestinat
2424
self.thread = thread
2525
self.threadListItem = threadListItem
2626
self.threadDestination = threadDestination
27-
self._selectedThread = selectedThread
27+
_selectedThread = selectedThread
2828
self.handleTabBarVisibility = handleTabBarVisibility
2929
}
3030

@@ -55,7 +55,7 @@ public struct ThreadSelectionInfo: Identifiable {
5555

5656
public init(thread: ChatThread) {
5757
self.thread = thread
58-
self.id = thread.id
58+
id = thread.id
5959
}
6060
}
6161

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ public struct ChatThreadListContentView<Factory: ViewFactory>: View {
104104
ThreadList(
105105
factory: viewFactory,
106106
threads: viewModel.threads,
107-
threadDestination: viewFactory.makeThreadDestination(),
107+
threadDestination: viewFactory.makeThreadDestination(),
108108
selectedThread: $viewModel.selectedThread,
109109
onItemTap: { thread in
110110
viewModel.selectedThread = .init(thread: thread)
111111
},
112112
onItemAppear: { index in
113113
viewModel.didAppearThread(at: index)
114-
},
114+
},
115115
headerView: {
116116
viewFactory.makeThreadListHeaderView(viewModel: viewModel)
117117
},

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListViewModel.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ open class ChatThreadListViewModel: ObservableObject, ChatThreadListControllerDe
5555
@Published public var hasNewThreads: Bool = false
5656

5757
/// The ids of the new threads available to be fetched.
58-
private var newAvailableThreadIds: Set<MessageId> = [] {
59-
didSet {
60-
newThreadsCount = newAvailableThreadIds.count
61-
hasNewThreads = newThreadsCount > 0
62-
}
63-
}
58+
private var newAvailableThreadIds: Set<MessageId> = [] {
59+
didSet {
60+
newThreadsCount = newAvailableThreadIds.count
61+
hasNewThreads = newThreadsCount > 0
62+
}
63+
}
6464

6565
/// Creates a view model for the `ChatThreadListView`.
6666
///

Sources/StreamChatSwiftUI/ChatThreadList/NoThreadsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SwiftUI
77
/// Default SDK implementation for the view displayed when there are no threads available.
88
public struct NoThreadsView: View {
99

10-
public init () {}
10+
public init() {}
1111

1212
public var body: some View {
1313
NoContentView(

Sources/StreamChatSwiftUI/CommonViews/FloatingBannerViewModifier.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ extension View {
2828
}
2929
}
3030

31-
3231
struct FloatingBannerViewModifier<BannerView: View>: ViewModifier {
3332
let alignment: Alignment
3433
var isPresented: Bool

Sources/StreamChatSwiftUI/CommonViews/Shimmer.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ struct Shimmer: ViewModifier {
2323
)
2424
.animation(
2525
.linear(duration: duration)
26-
.delay(delay)
27-
.repeatForever(autoreverses: false),
26+
.delay(delay)
27+
.repeatForever(autoreverses: false),
2828
value: isInitialState
2929
)
3030
.onAppear {
@@ -33,7 +33,6 @@ struct Shimmer: ViewModifier {
3333
}
3434
}
3535

36-
3736
extension View {
3837
/// Adds an animated shimmering effect to any view, typically to show that
3938
/// an operation is in progress.

Sources/StreamChatSwiftUI/DefaultViewFactory.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ extension ViewFactory {
238238
)
239239
}
240240
}
241+
241242
public func makeMessageListModifier() -> some ViewModifier {
242243
EmptyViewModifier()
243244
}

0 commit comments

Comments
 (0)