Conform more of the codebase to strictNullChecks (#10505
* Conform more of the codebase to `strictNullChecks` * Iterate * Conform more of the codebase to `strictNullChecks` * Iterate * Iterate * Iterate * Iterate
This commit is contained in:
parent
7503bf6b96
commit
e5a314617a
21 changed files with 76 additions and 83 deletions
|
@ -154,7 +154,7 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
|
|||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
const room = this.context.getRoom(this.props.mxEvent.getRoomId());
|
||||
const room = this.context?.getRoom(this.props.mxEvent.getRoomId());
|
||||
const poll = room?.polls.get(this.props.mxEvent.getId()!);
|
||||
if (poll) {
|
||||
this.setPollInstance(poll);
|
||||
|
@ -291,8 +291,8 @@ export default class MPollBody extends React.Component<IBodyProps, IState> {
|
|||
const votes = countVotes(userVotes, pollEvent);
|
||||
const totalVotes = this.totalVotes(votes);
|
||||
const winCount = Math.max(...votes.values());
|
||||
const userId = this.context.getUserId();
|
||||
const myVote = userVotes?.get(userId!)?.answers[0];
|
||||
const userId = this.context.getSafeUserId();
|
||||
const myVote = userVotes?.get(userId)?.answers[0];
|
||||
const disclosed = M_POLL_KIND_DISCLOSED.matches(pollEvent.kind.name);
|
||||
|
||||
// Disclosed: votes are hidden until I vote or the poll ends
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue