Skip to content

Commit 296b970

Browse files
committed
fix: cancel stale info panel queries
1 parent 7765962 commit 296b970

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/dashboard/Data/Browser/Browser.react.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ class Browser extends DashboardView {
302302
if (this.currentQuery) {
303303
this.currentQuery.cancel();
304304
}
305-
if (this.currentInfoPanelQuery && this.currentInfoPanelQuery.abort) {
306-
this.currentInfoPanelQuery.abort();
305+
if (this.currentInfoPanelQuery) {
306+
Parse.Query.cancel(this.currentInfoPanelQuery);
307307
this.currentInfoPanelQuery = null;
308308
}
309309
this.removeLocation();
@@ -353,8 +353,8 @@ class Browser extends DashboardView {
353353
}
354354

355355
fetchAggregationPanelData(objectId, className, appId) {
356-
if (this.currentInfoPanelQuery && this.currentInfoPanelQuery.abort) {
357-
this.currentInfoPanelQuery.abort();
356+
if (this.currentInfoPanelQuery) {
357+
Parse.Query.cancel(this.currentInfoPanelQuery);
358358
this.currentInfoPanelQuery = null;
359359
}
360360

@@ -365,19 +365,14 @@ class Browser extends DashboardView {
365365
const params = {
366366
object: Parse.Object.extend(className).createWithoutData(objectId).toPointer(),
367367
};
368-
let xhr;
369368
const options = {
370369
useMasterKey: true,
371-
requestTask: req => {
372-
xhr = req;
373-
},
374370
};
375371
const appName = this.props.params.appId;
376372
const cloudCodeFunction =
377373
this.state.classwiseCloudFunctions[`${appId}${appName}`]?.[className][0].cloudCodeFunction;
378374

379375
const promise = Parse.Cloud.run(cloudCodeFunction, params, options);
380-
promise.abort = () => xhr && xhr.abort();
381376
this.currentInfoPanelQuery = promise;
382377
promise.then(
383378
result => {

0 commit comments

Comments
 (0)