File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
components/peerdom/sources Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,17 @@ export default {
1919 _setLastId ( lastId ) {
2020 this . db . set ( "lastId" , lastId ) ;
2121 } ,
22+ sortItems ( items ) {
23+ return items ;
24+ } ,
2225 async emitEvent ( maxResults = false ) {
2326 const lastId = this . _getLastId ( ) ;
2427 const fn = this . getFunction ( ) ;
2528
26- const response = await fn ( ) ;
29+ const response = this . sortItems ( await fn ( ) ) ;
2730
2831 let responseArray = [ ] ;
29- for ( const item of response ) {
32+ for ( const item of response . reverse ( ) ) {
3033 if ( item . id == lastId ) break ;
3134 responseArray . push ( item ) ;
3235 }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default {
1515 return this . peerdom . listPeers ;
1616 } ,
1717 getSummary ( item ) {
18- return `New Member: ${ item . firstName } ${ item . lastName } ` ;
18+ return `New Member: ${ item . firstName } ${ item . lastName || "" } ` ;
1919 } ,
2020 } ,
2121 sampleEmit,
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ export default {
1717 getSummary ( item ) {
1818 return `New Role Created: ${ item . name } ` ;
1919 } ,
20+ sortItems ( items ) {
21+ return items . sort ( ( a , b ) => new Date ( a . createdAt ) - new Date ( b . createdAt ) ) ;
22+ } ,
2023 } ,
2124 sampleEmit,
2225} ;
You can’t perform that action at this time.
0 commit comments