Skip to content
Snippets Groups Projects
Commit e2cf40af authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Update state.myContactId on start in ChatFeature

parent 305c2f8a
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!87Messenger example - chat
...@@ -92,6 +92,7 @@ public let chatReducer = Reducer<ChatState, ChatAction, ChatEnvironment> ...@@ -92,6 +92,7 @@ public let chatReducer = Reducer<ChatState, ChatAction, ChatEnvironment>
state.failure = nil state.failure = nil
do { do {
let myContactId = try env.messenger.e2e.tryGet().getContact().getId() let myContactId = try env.messenger.e2e.tryGet().getContact().getId()
state.myContactId = myContactId
let queryChat: XXModels.Message.Query.Chat let queryChat: XXModels.Message.Query.Chat
switch state.id { switch state.id {
case .contact(let contactId): case .contact(let contactId):
......
...@@ -41,7 +41,9 @@ final class ChatFeatureTests: XCTestCase { ...@@ -41,7 +41,9 @@ final class ChatFeatureTests: XCTestCase {
return db return db
} }
store.send(.start) store.send(.start) {
$0.myContactId = myContactId
}
XCTAssertNoDifference(didFetchMessagesWithQuery, [ XCTAssertNoDifference(didFetchMessagesWithQuery, [
.init(chat: .direct(myContactId, contactId)) .init(chat: .direct(myContactId, contactId))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment