22 * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors 
33 * SPDX-License-Identifier: AGPL-3.0-or-later 
44 */ 
5- import  type  {  FilesTrashbinConfigState  }  from  '../../../files_trashbin/src/fileListActions/emptyTrashAction.ts' 
6- 
7- import  {  loadState  }  from  '@nextcloud/initial-state' 
8- import  {  Permission ,  Node ,  View ,  FileAction  }  from  '@nextcloud/files' 
95import  {  showInfo  }  from  '@nextcloud/dialogs' 
6+ import  {  Permission ,  Node ,  View ,  FileAction  }  from  '@nextcloud/files' 
7+ import  {  loadState  }  from  '@nextcloud/initial-state' 
108import  {  translate  as  t  }  from  '@nextcloud/l10n' 
119import  PQueue  from  'p-queue' 
1210
1311import  CloseSvg  from  '@mdi/svg/svg/close.svg?raw' 
1412import  NetworkOffSvg  from  '@mdi/svg/svg/network-off.svg?raw' 
1513import  TrashCanSvg  from  '@mdi/svg/svg/trash-can.svg?raw' 
1614
15+ import  {  TRASHBIN_VIEW_ID  }  from  '../../../files_trashbin/src/files_views/trashbinView.ts' 
16+ import  {  askConfirmation ,  canDisconnectOnly ,  canUnshareOnly ,  deleteNode ,  displayName ,  isTrashbinEnabled  }  from  './deleteUtils.ts' 
1717import  logger  from  '../logger.ts' 
18- import  {  askConfirmation ,  canDisconnectOnly ,  canUnshareOnly ,  deleteNode ,  displayName ,  isTrashbinEnabled  }  from  './deleteUtils' 
1918
2019const  queue  =  new  PQueue ( {  concurrency : 5  } ) 
2120
@@ -36,10 +35,12 @@ export const action = new FileAction({
3635		return  TrashCanSvg 
3736	} , 
3837
39- 	enabled ( nodes : Node [ ] )  { 
40- 		const  config  =  loadState < FilesTrashbinConfigState > ( 'files_trashbin' ,  'config' ) 
41- 		if  ( ! config . allow_delete )  { 
42- 			return  false 
38+ 	enabled ( nodes : Node [ ] ,  view : View ) : boolean  { 
39+ 		if  ( view . id  ===  TRASHBIN_VIEW_ID )  { 
40+ 			const  config  =  loadState ( 'files_trashbin' ,  'config' ,  {  allow_delete : true  } ) 
41+ 			if  ( config . allow_delete  ===  false )  { 
42+ 				return  false 
43+ 			} 
4344		} 
4445
4546		return  nodes . length  >  0  &&  nodes 
0 commit comments