Stopped crawls should not show stop/cancel buttons (#2101)
- crawler isActive() should only look at running states, not 'stopping', since stopping may not be reset to false after crawl is stopped (probably should reset, but also a record that the crawl ended as being stopped). crawl is guaranteed to remain in one of the active states while stopping on the backend - fixes #2100
This commit is contained in:
		
							parent
							
								
									87cc38b737
								
							
						
					
					
						commit
						00efb3615b
					
				| @ -140,8 +140,8 @@ export class ArchivedItemDetail extends BtrixElement { | ||||
| 
 | ||||
|   private timerId?: number; | ||||
| 
 | ||||
|   private get isActive(): boolean | null { | ||||
|     if (!this.item || this.item.type !== "crawl") return null; | ||||
|   private get isActive(): boolean { | ||||
|     if (!this.item || this.item.type !== "crawl") return false; | ||||
|     return isActive(this.item); | ||||
|   } | ||||
| 
 | ||||
|  | ||||
| @ -29,12 +29,8 @@ export const DEPTH_SUPPORTED_SCOPES = [ | ||||
|   "any", | ||||
| ]; | ||||
| 
 | ||||
| export function isActive({ state, stopping }: Partial<Crawl | QARun>) { | ||||
|   return ( | ||||
|     (state && | ||||
|       (activeCrawlStates as readonly string[]).includes(state as string)) || | ||||
|     stopping === true | ||||
|   ); | ||||
| export function isActive({ state }: Partial<Crawl | QARun>) { | ||||
|   return (activeCrawlStates as readonly (typeof state)[]).includes(state); | ||||
| } | ||||
| 
 | ||||
| export function isSuccessfullyFinished({ state }: { state: string }) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user