Conform more code to strictNullChecks
(#10444
* Conform more code to `strictNullChecks` * Fix tests * Fix tests
This commit is contained in:
parent
ba2608ec74
commit
c225b8ec29
29 changed files with 85 additions and 75 deletions
|
@ -38,7 +38,7 @@ export function RoomResultContextMenus({ room }: Props): JSX.Element {
|
|||
const [generalMenuPosition, setGeneralMenuPosition] = useState<DOMRect | null>(null);
|
||||
const [notificationMenuPosition, setNotificationMenuPosition] = useState<DOMRect | null>(null);
|
||||
|
||||
let generalMenu: JSX.Element;
|
||||
let generalMenu: JSX.Element | undefined;
|
||||
if (generalMenuPosition !== null) {
|
||||
if (room.isSpaceRoom()) {
|
||||
generalMenu = (
|
||||
|
@ -59,7 +59,7 @@ export function RoomResultContextMenus({ room }: Props): JSX.Element {
|
|||
}
|
||||
}
|
||||
|
||||
let notificationMenu: JSX.Element;
|
||||
let notificationMenu: JSX.Element | undefined;
|
||||
if (notificationMenuPosition !== null) {
|
||||
notificationMenu = (
|
||||
<RoomNotificationContextMenu
|
||||
|
|
|
@ -440,7 +440,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
|||
|
||||
// Sort results by most recent activity
|
||||
|
||||
const myUserId = cli.getUserId();
|
||||
const myUserId = cli.getSafeUserId();
|
||||
for (const resultArray of Object.values(results)) {
|
||||
resultArray.sort((a: Result, b: Result) => {
|
||||
if (isRoomResult(a) || isRoomResult(b)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue