@@ -43,7 +43,6 @@ export const enum SchemaActions {
4343 analysisStarted = 'schema-service/schema/analysisStarted' ,
4444 analysisFinished = 'schema-service/schema/analysisFinished' ,
4545 analysisFailed = 'schema-service/schema/analysisFailed' ,
46- analysisCancelled = 'schema-service/schema/analysisCancelled' ,
4746}
4847
4948export type AnalysisStartedAction = {
@@ -119,8 +118,10 @@ function resultId(): string {
119118export const handleSchemaShare = ( ) : SchemaThunkAction < void > => {
120119 return ( dispatch , getState , { namespace } ) => {
121120 const { schema } = getState ( ) ;
122- void navigator . clipboard . writeText ( JSON . stringify ( schema , null , ' ' ) ) ;
123121 const hasSchema = schema !== null ;
122+ if ( hasSchema ) {
123+ void navigator . clipboard . writeText ( JSON . stringify ( schema , null , ' ' ) ) ;
124+ }
124125 dispatch ( _trackSchemaShared ( hasSchema ) ) ;
125126 openToast (
126127 'share-schema' ,
@@ -209,6 +210,7 @@ export const geoLayersDeleted = (
209210
210211export const stopAnalysis = ( ) : SchemaThunkAction < void > => {
211212 return ( dispatch , getState , { abortControllerRef } ) => {
213+ if ( ! abortControllerRef ) return ;
212214 abortControllerRef . current ?. abort ( ) ;
213215 } ;
214216} ;
@@ -234,6 +236,11 @@ export const startAnalysis = (): SchemaThunkAction<
234236 track,
235237 }
236238 ) => {
239+ const { analysisState } = getState ( ) ;
240+ if ( analysisState === ANALYSIS_STATE_ANALYZING ) {
241+ debug ( 'analysis already in progress. ignoring subsequent start' ) ;
242+ return ;
243+ }
237244 const query = queryBar . getLastAppliedQuery ( 'schema' ) ;
238245
239246 const sampleSize = query . limit
0 commit comments