Skip to content

Commit ab4c9ab

Browse files
committed
better naming
1 parent da1da3b commit ab4c9ab

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

packages/ai-bot/helpers.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ function serializedCardFromFragments(
104104
);
105105
}
106106
let cardFragments: CardFragmentContent[] = [];
107-
let nextFragment: string | undefined = eventId;
107+
let currentFragment: string | undefined = eventId;
108108
do {
109-
let fragment = fragments.get(nextFragment);
109+
let fragment = fragments.get(currentFragment);
110110
if (!fragment) {
111111
throw new Error(
112112
`No card fragment found in cache for event id ${eventId}`,
113113
);
114114
}
115115
cardFragments.push(fragment);
116-
nextFragment = fragment.data.nextFragment;
117-
} while (nextFragment);
116+
currentFragment = fragment.data.nextFragment;
117+
} while (currentFragment);
118118

119119
cardFragments.sort((a, b) => (a.data.index = b.data.index));
120120
if (cardFragments.length !== cardFragments[0].data.totalParts) {

packages/base/room.gts

+4-4
Original file line numberDiff line numberDiff line change
@@ -550,17 +550,17 @@ export class RoomField extends FieldDef {
550550
}
551551

552552
let fragments: CardFragmentContent[] = [];
553-
let nextFragment: string | undefined = eventId;
553+
let currentFragment: string | undefined = eventId;
554554
do {
555-
let fragment = cache.get(nextFragment);
555+
let fragment = cache.get(currentFragment);
556556
if (!fragment) {
557557
throw new Error(
558558
`No card fragment found in cache for event id ${eventId}`,
559559
);
560560
}
561561
fragments.push(fragment);
562-
nextFragment = fragment.data.nextFragment;
563-
} while (nextFragment);
562+
currentFragment = fragment.data.nextFragment;
563+
} while (currentFragment);
564564

565565
fragments.sort((a, b) => (a.data.index = b.data.index));
566566
if (fragments.length !== fragments[0].data.totalParts) {

packages/host/app/lib/matrix-handlers/timeline.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ async function processDecryptedEvent(context: Context, event: Event) {
6262
Array.isArray(data.attachedCardsEventIds)
6363
) {
6464
for (let attachedCardEventId of data.attachedCardsEventIds) {
65-
let nextFragment: string | undefined = attachedCardEventId;
65+
let currentFragment: string | undefined = attachedCardEventId;
6666
do {
6767
let fragmentEvent = roomField.events.find(
68-
(e) => e.event_id === nextFragment,
68+
(e) => e.event_id === currentFragment,
6969
);
7070
let fragmentData: CardFragmentContent['data'];
7171
if (!fragmentEvent) {
@@ -90,8 +90,8 @@ async function processDecryptedEvent(context: Context, event: Event) {
9090
}
9191
fragmentData = fragmentEvent.content.data;
9292
}
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);
9595
}
9696
}
9797
}

0 commit comments

Comments
 (0)