File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ export class AddonPrivateFilesFileComponent extends CoreFileComponent implements
4040 this . onOpenMenuClick = new EventEmitter < CoreFileComponent > ( ) ;
4141 }
4242
43+ /**
44+ * Emits onOpenMenuClick event with the current instance.
45+ */
4346 openMenuClick ( ) : void {
4447 this . onOpenMenuClick . emit ( this ) ;
4548 }
Original file line number Diff line number Diff line change 1313 < h1 > {{ selectFilesEnabled() ? (selectedFiles.length + ' ' + title) : title }}</ h1 >
1414 </ ion-title >
1515 < ion-buttons slot ="end ">
16- @if (selectFilesEnabled()) {
16+ @if (selectFilesEnabled() && selectedFiles.length > 0 ) {
1717 < ion-button fill ="clear " (click) ="deleteSelectedFiles(true) " [ariaLabel] ="'core.delete' | translate " color ="danger ">
1818 < ion-icon slot ="icon-only " name ="fas-trash " aria-hidden ="true " />
1919 </ ion-button >
@@ -76,7 +76,7 @@ <h1>{{ selectFilesEnabled() ? (selectedFiles.length + ' ' + title) : title }}</h
7676 @if (showUpload && root !== 'site' && !path && !selectFilesEnabled()) {
7777 < ion-fab slot ="fixed " core-fab vertical ="bottom " horizontal ="end ">
7878 < ion-fab-button (click) ="uploadFile() " [attr.aria-label] ="'core.fileuploader.uploadafile' | translate ">
79- < ion-icon name ="fas-plus " aria-hidden ="true " />
79+ < ion-icon name ="fas-arrow-up-from-bracket " aria-hidden ="true " />
8080 < span class ="sr-only "> {{ 'core.fileuploader.uploadafile' | translate }}</ span >
8181 </ ion-fab-button >
8282 </ ion-fab >
Original file line number Diff line number Diff line change @@ -298,9 +298,18 @@ export class AddonPrivateFilesIndexPage implements OnInit, OnDestroy {
298298 * Delete private files.
299299 */
300300 async deleteSelectedFiles ( showConfirmation = false ) : Promise < void > {
301+ if ( this . selectedFiles . length === 0 ) {
302+ return ;
303+ }
304+
301305 if ( showConfirmation ) {
302306 try {
303- await CoreDomUtils . showDeleteConfirm ( 'core.confirmremoveselectedfiles' ) ;
307+ this . selectedFiles . length === 1
308+ ? await CoreDomUtils . showDeleteConfirm (
309+ 'core.confirmremoveselectedfile' ,
310+ { filename : this . selectedFiles [ 0 ] . filename } ,
311+ )
312+ : await CoreDomUtils . showDeleteConfirm ( 'core.confirmremoveselectedfiles' ) ;
304313 } catch {
305314 return ;
306315 }
@@ -360,6 +369,7 @@ export class AddonPrivateFilesIndexPage implements OnInit, OnDestroy {
360369 cancelFileSelection ( ) : void {
361370 this . selectFilesEnabled . set ( false ) ;
362371 this . selectedFiles = [ ] ;
372+ this . files = this . files ?. map ( file => ( { ...file , selected : false } ) ) ;
363373 }
364374
365375 /**
You can’t perform that action at this time.
0 commit comments