File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -382,21 +382,33 @@ export class BrowserProfilesList extends BtrixElement {
382
382
383
383
private async deleteProfile ( profile : Profile ) {
384
384
try {
385
- await this . api . fetch < Profile & { error ?: boolean } > (
385
+ const data = await this . api . fetch < Profile & { error ?: boolean } > (
386
386
`/orgs/${ this . orgId } /profiles/${ profile . id } ` ,
387
387
{
388
388
method : "DELETE" ,
389
389
} ,
390
390
) ;
391
391
392
- this . notify . toast ( {
393
- message : msg ( html `Deleted < strong > ${ profile . name } </ strong > .` ) ,
394
- variant : "success" ,
395
- icon : "check2-circle" ,
396
- id : "browser-profile-deleted-status" ,
397
- } ) ;
398
-
399
- void this . fetchBrowserProfiles ( ) ;
392
+ if ( data . error && data . inUse ) {
393
+ this . notify . toast ( {
394
+ message : msg (
395
+ html `Could not delete < strong > ${ profile . name } </ strong > , currently in
396
+ use. Please remove browser profile from all Crawl Workflows to
397
+ continue.` ,
398
+ ) ,
399
+ variant : "warning" ,
400
+ duration : 15000 ,
401
+ } ) ;
402
+ } else {
403
+ this . notify . toast ( {
404
+ message : msg ( html `Deleted < strong > ${ profile . name } </ strong > .` ) ,
405
+ variant : "success" ,
406
+ icon : "check2-circle" ,
407
+ id : "browser-profile-deleted-status" ,
408
+ } ) ;
409
+
410
+ void this . fetchBrowserProfiles ( ) ;
411
+ }
400
412
} catch ( e ) {
401
413
this . notify . toast ( {
402
414
message : msg ( "Sorry, couldn't delete browser profile at this time." ) ,
You can’t perform that action at this time.
0 commit comments