Skip to content

Commit c5cc8f1

Browse files
fix: Cancel save request directly in the save method
1 parent e67ce19 commit c5cc8f1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

panel/src/panel/content.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ export default (panel) => {
279279
async save(values = {}, env = {}) {
280280
// ensure to abort unfinished previous save request
281281
// to avoid race conditions with older content
282-
this.saveAbortController?.abort();
282+
this.cancelSaving();
283+
284+
// create a new abort controller
283285
this.saveAbortController = new AbortController();
284286

285287
try {
@@ -325,11 +327,6 @@ export default (panel) => {
325327
* Updates the form values of the current view
326328
*/
327329
async update(values = {}, env = {}) {
328-
// cancel any previous save request
329-
// to avoid race conditions with older content
330-
this.cancelSaving();
331-
332-
// send a new save request
333330
return await this.save(this.merge(values, env), env);
334331
},
335332

0 commit comments

Comments
 (0)