File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/dashboard/Data/Browser Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ class Browser extends DashboardView {
54
54
this . section = 'Core' ;
55
55
this . subsection = 'Browser' ;
56
56
this . noteTimeout = null ;
57
+ this . currentQuery = null ; // Track current query
57
58
const limit = window . localStorage ?. getItem ( 'browserLimit' ) ;
58
59
59
60
this . state = {
@@ -221,6 +222,9 @@ class Browser extends DashboardView {
221
222
}
222
223
223
224
componentWillUnmount ( ) {
225
+ if ( this . currentQuery ) {
226
+ this . currentQuery . cancel ( ) ;
227
+ }
224
228
this . removeLocation ( ) ;
225
229
window . removeEventListener ( 'mouseup' , this . onMouseUpRowCheckBox ) ;
226
230
}
@@ -897,6 +901,10 @@ class Browser extends DashboardView {
897
901
}
898
902
899
903
async fetchParseData ( source , filters ) {
904
+ if ( this . currentQuery ) {
905
+ this . currentQuery . cancel ( ) ;
906
+ }
907
+
900
908
const { useMasterKey, skip, limit } = this . state ;
901
909
this . setState ( {
902
910
data : null ,
@@ -916,6 +924,7 @@ class Browser extends DashboardView {
916
924
localStorage ?. setItem ( 'browserLimit' , limit ) ;
917
925
918
926
this . excludeFields ( query , source ) ;
927
+ this . currentQuery = query ;
919
928
let promise = query . find ( { useMasterKey } ) ;
920
929
let isUnique = false ;
921
930
let uniqueField = null ;
You can’t perform that action at this time.
0 commit comments