Conform more of the codebase to strictNullChecks (#10731)
This commit is contained in:
@@ -308,7 +308,7 @@ export default class RightPanelStore extends ReadyWatchingStore {
|
||||
if (card.phase === RightPanelPhases.RoomMemberInfo && card.state) {
|
||||
// RightPanelPhases.RoomMemberInfo -> needs to be changed to RightPanelPhases.EncryptionPanel if there is a pending verification request
|
||||
const { member } = card.state;
|
||||
const pendingRequest = pendingVerificationRequestForUser(member);
|
||||
const pendingRequest = member ? pendingVerificationRequestForUser(member) : undefined;
|
||||
if (pendingRequest) {
|
||||
return {
|
||||
phase: RightPanelPhases.EncryptionPanel,
|
||||
|
||||
@@ -71,8 +71,8 @@ interface IRightPanelForRoomStored {
|
||||
history: Array<IRightPanelCardStored>;
|
||||
}
|
||||
|
||||
export function convertToStorePanel(cacheRoom: IRightPanelForRoom): IRightPanelForRoomStored {
|
||||
if (!cacheRoom) return cacheRoom;
|
||||
export function convertToStorePanel(cacheRoom?: IRightPanelForRoom): IRightPanelForRoomStored | undefined {
|
||||
if (!cacheRoom) return undefined;
|
||||
const storeHistory = [...cacheRoom.history].map((panelState) => convertCardToStore(panelState));
|
||||
return { isOpen: cacheRoom.isOpen, history: storeHistory };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user