Skip to content

Commit 848fe48

Browse files
authored
chore(crud): explicitly not await for store actions in render (#7024)
1 parent 8b55f78 commit 848fe48

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

packages/compass-crud/src/components/editable-document.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class EditableDocument extends React.Component<
135135
const clonedDoc = this.props.doc.generateObject({
136136
excludeInternalFields: true,
137137
});
138-
this.props.openInsertDocumentDialog?.(clonedDoc, true);
138+
void this.props.openInsertDocumentDialog?.(clonedDoc, true);
139139
}
140140

141141
/**
@@ -267,13 +267,13 @@ class EditableDocument extends React.Component<
267267
deleting={this.state.deleting}
268268
onUpdate={(force) => {
269269
if (force) {
270-
this.props.replaceDocument?.(this.props.doc);
270+
void this.props.replaceDocument?.(this.props.doc);
271271
} else {
272-
this.props.updateDocument?.(this.props.doc);
272+
void this.props.updateDocument?.(this.props.doc);
273273
}
274274
}}
275275
onDelete={() => {
276-
this.props.removeDocument?.(this.props.doc);
276+
void this.props.removeDocument?.(this.props.doc);
277277
}}
278278
onCancel={() => {
279279
this.handleCancel();

packages/compass-crud/src/components/json-editor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const JSONEditor: React.FunctionComponent<JSONEditorProps> = ({
104104
const clonedDoc = doc.generateObject({
105105
excludeInternalFields: true,
106106
});
107-
openInsertDocumentDialog?.(clonedDoc, true);
107+
void openInsertDocumentDialog?.(clonedDoc, true);
108108
}, [doc, openInsertDocumentDialog]);
109109

110110
const onChange = useCallback((value: string) => {
@@ -137,7 +137,7 @@ const JSONEditor: React.FunctionComponent<JSONEditorProps> = ({
137137

138138
const onUpdate = useCallback(() => {
139139
doc.apply(HadronDocument.FromEJSON(value || ''));
140-
replaceDocument?.(doc);
140+
void replaceDocument?.(doc);
141141
}, [doc, replaceDocument, value]);
142142

143143
const onEditingFinished = useCallback(() => {
@@ -153,7 +153,7 @@ const JSONEditor: React.FunctionComponent<JSONEditorProps> = ({
153153
}, []);
154154

155155
const onDelete = useCallback(() => {
156-
removeDocument?.(doc);
156+
void removeDocument?.(doc);
157157
}, [doc, removeDocument]);
158158

159159
const onDeletionFinished = useCallback(() => {

packages/compass-crud/src/components/table-view/document-table-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class DocumentTableView extends React.Component<DocumentTableViewProps> {
187187
const clonedDoc = hadronDocument.generateObject({
188188
excludeInternalFields: true,
189189
});
190-
this.props.openInsertDocumentDialog?.(clonedDoc, true);
190+
void this.props.openInsertDocumentDialog?.(clonedDoc, true);
191191
};
192192

193193
/**

packages/compass-crud/src/components/table-view/full-width-cell-renderer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ class FullWidthCellRenderer extends React.Component<
134134
onUpdate={(force) => {
135135
this.props.api.stopEditing();
136136
if (force) {
137-
this.props.replaceDocument(this.doc);
137+
void this.props.replaceDocument(this.doc);
138138
} else {
139-
this.props.updateDocument(this.doc);
139+
void this.props.updateDocument(this.doc);
140140
}
141141
}}
142142
onDelete={() => {
143143
this.props.api.stopEditing();
144-
this.props.removeDocument(this.doc);
144+
void this.props.removeDocument(this.doc);
145145
}}
146146
onCancel={() => {
147147
if (this.state.mode === 'editing') {

0 commit comments

Comments
 (0)