Skip to content

Commit

Permalink
fix(rn): conversation pagination update
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Dec 11, 2018
1 parent 78756c5 commit 2de1b3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
6 changes: 2 additions & 4 deletions client/react-native/common/relay/genericUpdater.js
Expand Up @@ -49,11 +49,9 @@ export default (fragment, alias, args) => {
}

const edges = connection.getLinkedRecords('edges')
const field = Case.camel(args.orderBy || args.sortBy || 'id')
const cursor =
(args.orderBy && args.orderBy !== 'id') ||
(args.sortBy && args.sortBy !== 'id')
? data[Case.camel(args.orderBy || args.sortBy)]
: atob(data.id).split(':')[1]
field === 'id' ? atob(data.id).split(/:(.+)/)[1] : data[field]
if (edges.length > 0 && edges.some(e => e.getValue('cursor') === cursor)) {
// update
return
Expand Down
28 changes: 15 additions & 13 deletions client/react-native/common/utils/conversation.js
Expand Up @@ -6,16 +6,18 @@ export default {

export const getTitle = ({ title, members } = this.props) =>
(title && title !== '' && title) ||
members
.map((m, index) => {
const displayName =
m.contact && m.contact.status === 42
? 'Myself'
: (m.contact &&
(m.contact.overrideDisplayName || m.contact.displayName)) ||
'?????'
const before =
index === 0 ? '' : index === members.length - 1 ? ' and ' : ', '
return `${before}${displayName}`
})
.join('')
(members &&
members
.map((m, index) => {
const displayName =
m.contact && m.contact.status === 42
? 'Myself'
: (m.contact &&
(m.contact.overrideDisplayName || m.contact.displayName)) ||
'?????'
const before =
index === 0 ? '' : index === members.length - 1 ? ' and ' : ', '
return `${before}${displayName}`
})
.join('')) ||
'No name'

0 comments on commit 2de1b3f

Please sign in to comment.