mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-28 06:22:33 +00:00
fix: Manage Files count shows all files while searching (#32816)
The number next to the Files title in Manage Files stayed at the account's total while a search narrowed the list. While searching it now shows how many files are listed for the search, as before the redesign, and the total comes back once the search is cleared. Fixes #32815
This commit is contained in:
parent
3539ad6321
commit
c503f21470
1 changed files with 4 additions and 3 deletions
|
|
@ -55,6 +55,7 @@
|
|||
$: busy = selectionStatus === 'loading' || !!operation || showDeleteConfirmDialog;
|
||||
$: loadedSelected = (files ?? []).filter((file) => selectedIds.has(file.id)).length;
|
||||
$: allLoadedSelected = !!files?.length && loadedSelected === files.length;
|
||||
$: shownFileCount = query ? (files?.length ?? null) : fileCount;
|
||||
$: sortedFiles = [...(files ?? [])].sort((a, b) => {
|
||||
const result =
|
||||
orderBy === 'filename'
|
||||
|
|
@ -80,7 +81,7 @@
|
|||
files = more ? [...(files ?? []), ...result] : result;
|
||||
page = nextPage;
|
||||
allFilesLoaded = result.length < PAGE_SIZE;
|
||||
if (!more) {
|
||||
if (!more && !query) {
|
||||
const count = await getUserFileCount(localStorage.token);
|
||||
if (request === generation) fileCount = count;
|
||||
}
|
||||
|
|
@ -252,8 +253,8 @@
|
|||
<div class="mb-2 flex h-6 items-center gap-2">
|
||||
<div class="flex flex-1 items-center gap-1.5 text-sm font-medium">
|
||||
{$i18n.t('Files')}
|
||||
{#if fileCount !== null}<span class="text-xs font-normal tabular-nums text-gray-400"
|
||||
>{fileCount}</span
|
||||
{#if shownFileCount !== null}<span class="text-xs font-normal tabular-nums text-gray-400"
|
||||
>{shownFileCount}</span
|
||||
>{/if}
|
||||
</div>
|
||||
<Dropdown closeOnSelect align="end">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue