Conform more of the code base to strict null checking (#10147)
* Conform more of the code base to strict null checking * More strict fixes * More strict work * Fix missing optional type * Iterate
This commit is contained in:
parent
fa036a5080
commit
da7aa4055e
380 changed files with 682 additions and 694 deletions
|
@ -69,12 +69,12 @@ export const makeThreadEvents = ({
|
|||
ts,
|
||||
});
|
||||
|
||||
const rootEventId = rootEvent.getId();
|
||||
const rootEventId = rootEvent.getId()!;
|
||||
const events = [rootEvent];
|
||||
|
||||
for (let i = 1; i < length; i++) {
|
||||
const prevEvent = events[i - 1];
|
||||
const replyToEventId = prevEvent.getId();
|
||||
const replyToEventId = prevEvent.getId()!;
|
||||
const user = participantUserIds[i % participantUserIds.length];
|
||||
events.push(
|
||||
makeThreadEvent({
|
||||
|
@ -95,7 +95,7 @@ export const makeThreadEvents = ({
|
|||
[RelationType.Thread]: {
|
||||
latest_event: events[events.length - 1],
|
||||
count: length,
|
||||
current_user_participated: [...participantUserIds, authorId].includes(currentUserId),
|
||||
current_user_participated: [...participantUserIds, authorId].includes(currentUserId!),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -126,7 +126,7 @@ export const mkThread = ({
|
|||
participantUserIds,
|
||||
length,
|
||||
ts,
|
||||
currentUserId: client.getUserId(),
|
||||
currentUserId: client.getUserId()!,
|
||||
});
|
||||
expect(rootEvent).toBeTruthy();
|
||||
|
||||
|
@ -134,7 +134,7 @@ export const mkThread = ({
|
|||
room?.reEmitter.reEmit(evt, [MatrixEventEvent.BeforeRedaction]);
|
||||
}
|
||||
|
||||
const thread = room.createThread(rootEvent.getId(), rootEvent, events, true);
|
||||
const thread = room.createThread(rootEvent.getId()!, rootEvent, events, true);
|
||||
// So that we do not have to mock the thread loading
|
||||
thread.initialEventsFetched = true;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue