Skip to content

Commit

Permalink
Merge pull request #3058 from vnetonline/fix-file-manager-show-folders
Browse files Browse the repository at this point in the history
[ENHANCE] - #3057 FileManager when ShowFolders = False however a Folder is set by path
  • Loading branch information
sbwalker authored Aug 2, 2023
2 parents 8c6bca7 + 2c905ed commit 765041c
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Oqtane.Client/Modules/Controls/FileManager.razor
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,21 @@
ShowSuccess = true;
}

if (!string.IsNullOrEmpty(Folder) && Folder != Constants.PackagesFolder)
{
Folder folder = await FolderService.GetFolderAsync(ModuleState.SiteId, Folder);
if (folder != null)
{
FolderId = folder.FolderId;
}
else
{
FolderId = -1;
_message = "Folder Path " + Folder + "Does Not Exist";
_messagetype = MessageType.Error;
}
}

if (ShowFolders)
{
_folders = await FolderService.GetFoldersAsync(ModuleState.SiteId);
Expand All @@ -184,21 +199,6 @@
}
}

if (!string.IsNullOrEmpty(Folder) && Folder != Constants.PackagesFolder)
{
Folder folder = await FolderService.GetFolderAsync(ModuleState.SiteId, Folder);
if (folder != null)
{
FolderId = folder.FolderId;
}
else
{
FolderId = -1;
_message = "Folder Path " + Folder + "Does Not Exist";
_messagetype = MessageType.Error;
}
}

if (FileId != -1)
{
File file = await FileService.GetFileAsync(FileId);
Expand Down

0 comments on commit 765041c

Please sign in to comment.