Conform more code to strictNullChecks (#10374)

* Apply `strictNullChecks` to `src/components/views/room_settings/*`

* Restore tsconfig.json

* Conform more code to `strictNullChecks`

* Iterate

* Update matrix-widget-api

* Conform more code to `strictNullChecks`
This commit is contained in:
Michael Telatynski
2023-03-16 11:07:29 +00:00
committed by GitHub
parent 9c816bb720
commit 1c9ea423c9
44 changed files with 223 additions and 179 deletions

View File

@@ -62,14 +62,14 @@ export class ModalWidgetStore extends AsyncStoreWithClient<IState> {
): void => {
if (this.modalInstance) return;
this.openSourceWidgetId = sourceWidget.id;
this.openSourceWidgetRoomId = widgetRoomId;
this.openSourceWidgetRoomId = widgetRoomId ?? null;
this.modalInstance = Modal.createDialog(
ModalWidgetDialog,
{
widgetDefinition: { ...requestData },
widgetRoomId,
sourceWidgetId: sourceWidget.id,
onFinished: (success: boolean, data?: IModalWidgetReturnData) => {
onFinished: (success, data) => {
if (!success) {
this.closeModalWidget(sourceWidget, widgetRoomId, { "m.exited": true });
} else {
@@ -81,13 +81,17 @@ export class ModalWidgetStore extends AsyncStoreWithClient<IState> {
this.modalInstance = null;
},
},
null,
undefined,
/* priority = */ false,
/* static = */ true,
);
};
public closeModalWidget = (sourceWidget: Widget, widgetRoomId?: string, data?: IModalWidgetReturnData): void => {
public closeModalWidget = (
sourceWidget: Widget,
widgetRoomId: string | undefined,
data: IModalWidgetReturnData,
): void => {
if (!this.modalInstance) return;
if (this.openSourceWidgetId === sourceWidget.id && this.openSourceWidgetRoomId === widgetRoomId) {
this.openSourceWidgetId = null;