Skip to content

Commit d28b04b

Browse files
committed
Update Browser.react.js
1 parent f196b47 commit d28b04b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class Browser extends DashboardView {
5454
this.section = 'Core';
5555
this.subsection = 'Browser';
5656
this.noteTimeout = null;
57+
this.currentQuery = null; // Track current query
5758
const limit = window.localStorage?.getItem('browserLimit');
5859

5960
this.state = {
@@ -221,6 +222,9 @@ class Browser extends DashboardView {
221222
}
222223

223224
componentWillUnmount() {
225+
if (this.currentQuery) {
226+
this.currentQuery.cancel();
227+
}
224228
this.removeLocation();
225229
window.removeEventListener('mouseup', this.onMouseUpRowCheckBox);
226230
}
@@ -897,6 +901,10 @@ class Browser extends DashboardView {
897901
}
898902

899903
async fetchParseData(source, filters) {
904+
if (this.currentQuery) {
905+
this.currentQuery.cancel();
906+
}
907+
900908
const { useMasterKey, skip, limit } = this.state;
901909
this.setState({
902910
data: null,
@@ -916,6 +924,7 @@ class Browser extends DashboardView {
916924
localStorage?.setItem('browserLimit', limit);
917925

918926
this.excludeFields(query, source);
927+
this.currentQuery = query;
919928
let promise = query.find({ useMasterKey });
920929
let isUnique = false;
921930
let uniqueField = null;

0 commit comments

Comments
 (0)