File tree Expand file tree Collapse file tree 2 files changed +30
-21
lines changed
core/platforms/nodejs-ssb Expand file tree Collapse file tree 2 files changed +30
-21
lines changed Original file line number Diff line number Diff line change @@ -352,30 +352,38 @@ class NodeJsSSB {
352352 } )
353353 }
354354
355- async profile ( feedid ) {
356- let opts = {
357- id : feedid ,
358- reverse : true ,
359- }
355+ profile ( feedid ) {
356+ return new Promise ( ( resolve , reject ) => {
357+ let opts = {
358+ id : feedid ,
359+ reverse : true ,
360+ }
360361
361- let user = {
362- msgs : [ ] ,
363- about : await this . aboutMessages ( feedid , feedid ) ,
364- }
365- const pipeline = pipelines . thread . get ( )
362+ let user = {
363+ msgs : [ ] ,
364+ about : { } ,
365+ }
366366
367- pull (
368- sbot . createUserStream ( opts ) ,
369- pull . apply ( pull , pipeline ) ,
370- pull . collect ( function ( err , data ) {
371- if ( err ) {
372- throw err
373- } else {
374- user . msgs = data
375- return user
376- }
367+ this . aboutMessages ( feedid , feedid ) . then ( data => {
368+ user . about = data
369+
370+ const pipeline = pipelines . thread . get ( )
371+
372+ pull (
373+ sbot . createUserStream ( opts ) ,
374+ pull . apply ( pull , pipeline ) ,
375+ pull . collect ( function ( err , data ) {
376+ if ( err ) {
377+ reject ( err )
378+ } else {
379+ user . msgs = data
380+ console . log ( 'user' , user )
381+ resolve ( user )
382+ }
383+ } )
384+ )
377385 } )
378- )
386+ } )
379387 }
380388
381389 get ( id ) {
Original file line number Diff line number Diff line change 4646 })
4747
4848 aboutPromise = ssb .profile (feed).then (data => {
49+ console .log (data)
4950 lastAbout = data .about .reverse ().find (m => {
5051 let a = m .value .content
5152 return a .hasOwnProperty (" description" )
You can’t perform that action at this time.
0 commit comments