File tree 3 files changed +12
-12
lines changed
host/app/lib/matrix-handlers
3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -104,17 +104,17 @@ function serializedCardFromFragments(
104
104
) ;
105
105
}
106
106
let cardFragments : CardFragmentContent [ ] = [ ] ;
107
- let nextFragment : string | undefined = eventId ;
107
+ let currentFragment : string | undefined = eventId ;
108
108
do {
109
- let fragment = fragments . get ( nextFragment ) ;
109
+ let fragment = fragments . get ( currentFragment ) ;
110
110
if ( ! fragment ) {
111
111
throw new Error (
112
112
`No card fragment found in cache for event id ${ eventId } ` ,
113
113
) ;
114
114
}
115
115
cardFragments . push ( fragment ) ;
116
- nextFragment = fragment . data . nextFragment ;
117
- } while ( nextFragment ) ;
116
+ currentFragment = fragment . data . nextFragment ;
117
+ } while ( currentFragment ) ;
118
118
119
119
cardFragments . sort ( ( a , b ) => ( a . data . index = b . data . index ) ) ;
120
120
if ( cardFragments . length !== cardFragments [ 0 ] . data . totalParts ) {
Original file line number Diff line number Diff line change @@ -550,17 +550,17 @@ export class RoomField extends FieldDef {
550
550
}
551
551
552
552
let fragments: CardFragmentContent [] = [];
553
- let nextFragment : string | undefined = eventId ;
553
+ let currentFragment : string | undefined = eventId ;
554
554
do {
555
- let fragment = cache .get (nextFragment );
555
+ let fragment = cache .get (currentFragment );
556
556
if (! fragment ) {
557
557
throw new Error (
558
558
` No card fragment found in cache for event id ${eventId } ` ,
559
559
);
560
560
}
561
561
fragments .push (fragment );
562
- nextFragment = fragment .data .nextFragment ;
563
- } while (nextFragment );
562
+ currentFragment = fragment .data .nextFragment ;
563
+ } while (currentFragment );
564
564
565
565
fragments .sort ((a , b ) => (a .data .index = b .data .index ));
566
566
if (fragments .length !== fragments [0 ].data .totalParts ) {
Original file line number Diff line number Diff line change @@ -62,10 +62,10 @@ async function processDecryptedEvent(context: Context, event: Event) {
62
62
Array . isArray ( data . attachedCardsEventIds )
63
63
) {
64
64
for ( let attachedCardEventId of data . attachedCardsEventIds ) {
65
- let nextFragment : string | undefined = attachedCardEventId ;
65
+ let currentFragment : string | undefined = attachedCardEventId ;
66
66
do {
67
67
let fragmentEvent = roomField . events . find (
68
- ( e ) => e . event_id === nextFragment ,
68
+ ( e ) => e . event_id === currentFragment ,
69
69
) ;
70
70
let fragmentData : CardFragmentContent [ 'data' ] ;
71
71
if ( ! fragmentEvent ) {
@@ -90,8 +90,8 @@ async function processDecryptedEvent(context: Context, event: Event) {
90
90
}
91
91
fragmentData = fragmentEvent . content . data ;
92
92
}
93
- nextFragment = fragmentData ?. nextFragment ; // using '?' so we can be kind to older event schemas
94
- } while ( nextFragment ) ;
93
+ currentFragment = fragmentData ?. nextFragment ; // using '?' so we can be kind to older event schemas
94
+ } while ( currentFragment ) ;
95
95
}
96
96
}
97
97
}
You can’t perform that action at this time.
0 commit comments