Skip to content

Commit 34d1be9

Browse files
Updated to the latest StreamChat version
1 parent 33de07d commit 34d1be9

File tree

13 files changed

+299
-180
lines changed

13 files changed

+299
-180
lines changed

DemoAppSwiftUI/AppDelegate.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,15 @@ class AppDelegate: NSObject, UIApplicationDelegate {
8787
return
8888
}
8989

90-
chatClient.currentUserController().addDevice(token: deviceToken) { error in
90+
chatClient.currentUserController().addDevice(.apn(token: deviceToken)) { error in
9191
if let error = error {
9292
log.error("adding a device failed with an error \(error)")
9393
return
9494
}
95-
UserDefaults(suiteName: applicationGroupIdentifier)?.set(currentUserId, forKey: currentUserIdRegisteredForPush)
95+
UserDefaults(suiteName: applicationGroupIdentifier)?.set(
96+
currentUserId,
97+
forKey: currentUserIdRegisteredForPush
98+
)
9699
}
97100
}
98101
}

Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ struct MessageContainerView<Factory: ViewFactory>: View {
125125
}
126126
)
127127
.onChange(of: offset, perform: { _ in
128+
if !channel.config.quotesEnabled {
129+
return
130+
}
131+
128132
if offset == .zero {
129133
// gesture ended or cancelled
130134
setOffsetX(value: 0)

Sources/StreamChatSwiftUI/ChatChannel/Reactions/MessageActions/DefaultMessageActions.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ extension MessageAction {
4444
return messageActions
4545
}
4646

47-
if channel.config.repliesEnabled {
47+
if channel.config.quotesEnabled {
4848
let replyAction = replyAction(
4949
for: message,
5050
channel: channel,
5151
onFinish: onFinish
5252
)
5353
messageActions.append(replyAction)
54-
55-
if !message.isPartOfThread {
56-
let replyThread = threadReplyAction(
57-
factory: factory,
58-
for: message,
59-
channel: channel
60-
)
61-
messageActions.append(replyThread)
62-
}
54+
}
55+
56+
if channel.config.repliesEnabled && !message.isPartOfThread {
57+
let replyThread = threadReplyAction(
58+
factory: factory,
59+
for: message,
60+
channel: channel
61+
)
62+
messageActions.append(replyThread)
6363
}
6464

6565
if message.pinDetails != nil {

Sources/StreamChatSwiftUI/CommonViews/SearchBar.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ struct SearchBar: View, KeyboardReadable {
4646
}
4747
)
4848
.padding(.horizontal, 8)
49-
.onTapGesture {
50-
self.isEditing = true
51-
}
5249
.transition(.identity)
5350
.animation(.easeInOut, value: isEditing)
5451

@@ -70,6 +67,9 @@ struct SearchBar: View, KeyboardReadable {
7067
}
7168
.padding(.top, 8)
7269
.onReceive(keyboardWillChangePublisher) { shown in
70+
if shown {
71+
self.isEditing = true
72+
}
7373
if !shown && isEditing {
7474
self.isEditing = false
7575
}

StreamChatSwiftUI.xcodeproj/project.pbxproj

Lines changed: 46 additions & 53 deletions
Large diffs are not rendered by default.

StreamChatSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 47 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StreamChatSwiftUITests/Infrastructure/Mocks/WebSocketClient_Mock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extension WebSocketClientMock {
6262
sessionConfiguration: .ephemeral,
6363
requestEncoder: DefaultRequestEncoder(baseURL: .unique(), apiKey: .init(.unique)),
6464
eventDecoder: EventDecoder(),
65-
eventNotificationCenter: EventNotificationCenterMock(database: DatabaseContainerMock())
65+
eventNotificationCenter: EventNotificationCenterMock(database: DatabaseContainer_Spy())
6666
)
6767
}
6868
}

0 commit comments

Comments
 (0)