@@ -11,6 +11,7 @@ import Vue from 'vue'
1111
1212import FileListFilterAccount from '../components/FileListFilterAccount.vue'
1313import { isPublicShare } from '@nextcloud/sharing/public'
14+ import { TRASHBIN_VIEW_ID } from '../../../files_trashbin/src/files_views/trashbinView'
1415
1516export interface IAccountData {
1617 uid : string
@@ -62,19 +63,30 @@ class AccountFilter extends FileListFilter {
6263 const userIds = this . filterAccounts . map ( ( { uid } ) => uid )
6364 // Filter if the owner of the node is in the list of filtered accounts
6465 return nodes . filter ( ( node ) => {
65- const sharees = node . attributes . sharees ?. sharee as { id : string } [ ] | undefined
66- // If the node provides no information lets keep it
67- if ( ! node . owner && ! sharees ) {
68- return true
66+ if ( window . OCP . Files . Router . params . view === TRASHBIN_VIEW_ID ) {
67+ const deletedBy = node . attributes ?. [ 'trashbin-deleted-by-id' ]
68+ if ( deletedBy && userIds . includes ( deletedBy ) ) {
69+ return true
70+ }
71+ return false
6972 }
73+
7074 // if the owner matches
7175 if ( node . owner && userIds . includes ( node . owner ) ) {
7276 return true
7377 }
78+
7479 // Or any of the sharees (if only one share this will be an object, otherwise an array. So using `.flat()` to make it always an array)
80+ const sharees = node . attributes . sharees ?. sharee as { id : string } [ ] | undefined
7581 if ( sharees && [ sharees ] . flat ( ) . some ( ( { id } ) => userIds . includes ( id ) ) ) {
7682 return true
7783 }
84+
85+ // If the node provides no information lets keep it
86+ if ( ! node . owner && ! sharees ) {
87+ return true
88+ }
89+
7890 // Not a valid node for the current filter
7991 return false
8092 } )
@@ -139,6 +151,15 @@ class AccountFilter extends FileListFilter {
139151 } )
140152 }
141153 }
154+
155+ // lets also handle trashbin
156+ const deletedBy = node . attributes ?. [ 'trashbin-deleted-by-id' ]
157+ if ( deletedBy ) {
158+ available . set ( deletedBy , {
159+ uid : deletedBy ,
160+ displayName : node . attributes ?. [ 'trashbin-deleted-by-display-name' ] || deletedBy ,
161+ } )
162+ }
142163 }
143164
144165 this . availableAccounts = [ ...available . values ( ) ]
0 commit comments