Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rn): conversation new message updater
fix #624 Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
- Loading branch information
Showing
16 changed files
with
144 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,5 +50,7 @@ export default context => (input, configs) => | |
...contact.default, | ||
...input, | ||
}, | ||
configs | ||
{ | ||
...configs, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 10 additions & 12 deletions
22
client/react-native/common/graphql/subscriptions/ConversationNewMessage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import EventStream from './EventStream' | ||
|
||
export default conversation => ({ | ||
...EventStream, | ||
export default context => ({ | ||
...EventStream(context), | ||
subscribe: ({ updater }) => | ||
EventStream.subscribe({ | ||
updater: (store, data) => { | ||
console.log('RECEIVED_EVENT') | ||
if ( | ||
data.EventStream.kind === 302 && | ||
data.EventStream.conversationId === conversation.id | ||
) { | ||
return updater && updater(store, data.EventStream) | ||
} | ||
}, | ||
EventStream(context).subscribe({ | ||
updater: | ||
updater && | ||
((store, data) => { | ||
if (data.EventStream.kind === 302) { | ||
return updater(store, data.EventStream) | ||
} | ||
}), | ||
}), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.