web/satellite: fix object count calculation inside folders

Moved .file_placeholder decrement logic to be outside continuation tokens loop so that object count is decremented only once.

Change-Id: Ie19657753b501df9344dc84d7be2bfb731933faa
This commit is contained in:
Vitalii 2023-10-13 15:08:42 +03:00 committed by Vitalii Shpital
parent ad13cb2bf5
commit 7381b5e508

View File

@ -297,12 +297,6 @@ export const useObjectBrowserStore = defineStore('objectBrowser', () => {
}
keyCount += response.KeyCount ?? 0;
// We decrement key count if we're inside a folder to exclude .file_placeholder object
// which was auto created for this folder because it's not visible by the user
// and it shouldn't be included in pagination process.
if (path) {
keyCount -= 1;
}
if (!response.NextContinuationToken) break;
@ -310,6 +304,13 @@ export const useObjectBrowserStore = defineStore('objectBrowser', () => {
iteration++;
}
// We decrement key count if we're inside a folder to exclude .file_placeholder object
// which was auto created for this folder because it's not visible by the user
// and it shouldn't be included in pagination process.
if (path) {
keyCount -= 1;
}
state.totalObjectCount = keyCount;
}