From 505a496357bd8caeaad665488d7748dd2d36e936 Mon Sep 17 00:00:00 2001 From: Aneri Bania Date: Mon, 30 May 2022 16:42:10 +0530 Subject: [PATCH 1/2] XOR-155 [FIX] Ensure the progress bar of storage should change when delete the files --- js/interface.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/js/interface.js b/js/interface.js index cd69f2f..84ec21c 100644 --- a/js/interface.js +++ b/js/interface.js @@ -620,6 +620,8 @@ function removeTrashItems(items) { } return updateAppMetrics(itemAppId); + }).then(function() { + toggleStorageUsage(); }).catch(function(error) { showSpinner(false); Fliplet.Modal.alert({ @@ -1101,7 +1103,7 @@ function getTrashFilesData(filterFiles, filterFolders) { mediaFiles.forEach(parseThumbnail); - $('.file-deleted-cell').removeClass('hidden') + $('.file-deleted-cell').removeClass('hidden'); $('.file-date-cell').hide(); $('.file-deleted-cell').show(); @@ -1760,11 +1762,11 @@ function createFolder(event, folderName) { } if (result.length > 45) { - Fliplet.Modal.alert({ + Fliplet.Modal.alert({ title: 'Failed to create folder', message: 'Folder name must be 45 characters or less' - }).then(function () { - createFolder(null, result) + }).then(function() { + createFolder(null, result); }); return; @@ -1776,23 +1778,23 @@ function createFolder(event, folderName) { name: dataSourceName, parentId: currentFolderId || undefined }; - + if (lastFolderSelected.type === 'appId') { options.appId = lastFolderSelected.id; } else if (lastFolderSelected.type === 'organizationId') { options.organizationId = lastFolderSelected.id; } else { options.parentId = lastFolderSelected.id; - + if (lastFolderSelected.organizationId !== null) { options.organizationId = lastFolderSelected.organizationId; } else if (lastFolderSelected.appId !== null) { options.appId = lastFolderSelected.appId; } } - + showSpinner(true); - + Fliplet.Media.Folders.create(options).then(function(folder) { addFolder(folder); insertItem(folder, true); @@ -1803,8 +1805,8 @@ function createFolder(event, folderName) { message: Fliplet.parseError(err) }); }); - - $newBtn.click(); + + $newBtn.click(); }); } @@ -1932,7 +1934,7 @@ $('.file-manager-wrapper') }); $progress.addClass('hidden'); - + return updateAppMetrics(currentAppId); }).then(function() { toggleStorageUsage(); @@ -2061,6 +2063,10 @@ $('.file-manager-wrapper') $('.empty-state').addClass('active'); } }); + + return updateAppMetrics(currentAppId); + }).then(function() { + toggleStorageUsage(); }).catch(function(err) { showSpinner(false); From fedbd7b67061e1e5097e3e6d927d689959577521 Mon Sep 17 00:00:00 2001 From: Aneri Bania Date: Wed, 1 Jun 2022 13:01:55 +0530 Subject: [PATCH 2/2] XOR-155 [FIX} Ensure progress bar updated when file delete from folders --- js/interface.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/interface.js b/js/interface.js index 84ec21c..ed72d41 100644 --- a/js/interface.js +++ b/js/interface.js @@ -2075,6 +2075,10 @@ $('.file-manager-wrapper') }); }); } + + return updateAppMetrics(currentAppId); + }).then(function() { + toggleStorageUsage(); }); }) .on('click', '[download-action]', function() {