Apply strictNullChecks
to src/components/views/dialogs/devtools/*
(#10391)
This commit is contained in:
parent
5211b628d6
commit
b2c046689e
9 changed files with 34 additions and 26 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
Copyright 2022 Michael Telatynski <7t3chguy@gmail.com>
|
||||
Copyright 2023 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -29,7 +30,7 @@ export const AccountDataEventEditor: React.FC<IEditorProps> = ({ mxEvent, onBack
|
|||
const fields = useMemo(() => [eventTypeField(mxEvent?.getType())], [mxEvent]);
|
||||
|
||||
const onSend = async ([eventType]: string[], content?: IContent): Promise<void> => {
|
||||
await cli.setAccountData(eventType, content);
|
||||
await cli.setAccountData(eventType, content || {});
|
||||
};
|
||||
|
||||
const defaultContent = mxEvent ? stringify(mxEvent.getContent()) : undefined;
|
||||
|
@ -43,7 +44,7 @@ export const RoomAccountDataEventEditor: React.FC<IEditorProps> = ({ mxEvent, on
|
|||
const fields = useMemo(() => [eventTypeField(mxEvent?.getType())], [mxEvent]);
|
||||
|
||||
const onSend = async ([eventType]: string[], content?: IContent): Promise<void> => {
|
||||
await cli.setRoomAccountData(context.room.roomId, eventType, content);
|
||||
await cli.setRoomAccountData(context.room.roomId, eventType, content || {});
|
||||
};
|
||||
|
||||
const defaultContent = mxEvent ? stringify(mxEvent.getContent()) : undefined;
|
||||
|
@ -58,7 +59,7 @@ interface IProps extends IDevtoolsProps {
|
|||
|
||||
const BaseAccountDataExplorer: React.FC<IProps> = ({ events, Editor, actionLabel, onBack, setTool }) => {
|
||||
const [query, setQuery] = useState("");
|
||||
const [event, setEvent] = useState<MatrixEvent>(null);
|
||||
const [event, setEvent] = useState<MatrixEvent | null>(null);
|
||||
|
||||
if (event) {
|
||||
const onBack = (): void => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue