diff --git a/src/app/features/files/pages/files/files.component.html b/src/app/features/files/pages/files/files.component.html
index d5dabbd9e..2e25ce491 100644
--- a/src/app/features/files/pages/files/files.component.html
+++ b/src/app/features/files/pages/files/files.component.html
@@ -25,14 +25,16 @@
@if (filesSelection.length) {
-
+ @if (!isMoveDialogOpened()) {
+
+ }
} @else {
@@ -146,6 +148,7 @@
(setCurrentFolder)="setCurrentFolder($event)"
(setMoveDialogCurrentFolder)="setMoveDialogCurrentFolder($event)"
(updateFoldersStack)="onUpdateFoldersStack($event)"
+ (resetFilesProvider)="resetProvider()"
>
diff --git a/src/app/features/files/pages/files/files.component.ts b/src/app/features/files/pages/files/files.component.ts
index c3048e8ef..431277fc1 100644
--- a/src/app/features/files/pages/files/files.component.ts
+++ b/src/app/features/files/pages/files/files.component.ts
@@ -159,6 +159,7 @@ export class FilesComponent {
currentRootFolder = model
(null);
fileIsUploading = signal(false);
+ isMoveDialogOpened = signal(false);
sortOptions = ALL_SORT_OPTIONS;
@@ -482,6 +483,7 @@ export class FilesComponent {
moveFiles(files: FileModel[], action: string): void {
const currentFolder = this.currentFolder();
this.actions.setMoveDialogCurrentFolder(currentFolder);
+ this.isMoveDialogOpened.set(true);
this.customDialogService
.open(MoveFileDialogComponent, {
header: 'files.dialogs.moveFile.title',
@@ -499,14 +501,19 @@ export class FilesComponent {
if (result) {
this.filesSelection = [];
}
- const currentRootFolder = this.currentRootFolder();
- const provider = currentRootFolder?.folder?.provider;
- if (provider) {
- this.actions.setCurrentProvider(provider);
- }
+ this.isMoveDialogOpened.set(false);
+ this.resetProvider();
});
}
+ resetProvider() {
+ const currentRootFolder = this.currentRootFolder();
+ const provider = currentRootFolder?.folder?.provider;
+ if (provider) {
+ this.actions.setCurrentProvider(provider);
+ }
+ }
+
createFolder(): void {
const currentFolder = this.currentFolder();
const newFolderLink = currentFolder?.links.newFolder;
diff --git a/src/app/shared/components/files-tree/files-tree.component.ts b/src/app/shared/components/files-tree/files-tree.component.ts
index 87a666de2..5235f17cc 100644
--- a/src/app/shared/components/files-tree/files-tree.component.ts
+++ b/src/app/shared/components/files-tree/files-tree.component.ts
@@ -99,6 +99,7 @@ export class FilesTreeComponent implements OnDestroy, AfterViewInit {
unselectFile = output();
clearSelection = output();
updateFoldersStack = output();
+ resetFilesProvider = output();
readonly resourceMetadata = select(CurrentResourceSelectors.getCurrentResource);
@@ -384,18 +385,22 @@ export class FilesTreeComponent implements OnDestroy, AfterViewInit {
moveFile(file: FileModel, action: string): void {
this.setMoveDialogCurrentFolder.emit(this.currentFolder());
- this.customDialogService.open(MoveFileDialogComponent, {
- header: 'files.dialogs.moveFile.title',
- width: '552px',
- data: {
- files: [file],
- resourceId: this.resourceId(),
- action: action,
- storageProvider: this.storage()?.folder.provider,
- foldersStack: structuredClone(this.foldersStack),
- initialFolder: structuredClone(this.currentFolder()),
- },
- });
+ this.customDialogService
+ .open(MoveFileDialogComponent, {
+ header: 'files.dialogs.moveFile.title',
+ width: '552px',
+ data: {
+ files: [file],
+ resourceId: this.resourceId(),
+ action: action,
+ storageProvider: this.storage()?.folder.provider,
+ foldersStack: structuredClone(this.foldersStack),
+ initialFolder: structuredClone(this.currentFolder()),
+ },
+ })
+ .onClose.subscribe(() => {
+ this.resetFilesProvider.emit();
+ });
}
copyToClipboard(embedHtml: string): void {