Fix sorting in storage explorer (#35975)

* Fix sorting in storage explorer

* Fix check size
This commit is contained in:
Terry Sutton
2025-05-28 16:07:11 -02:30
committed by GitHub
parent 8aea2cd6c7
commit f908da2ccf
2 changed files with 11 additions and 5 deletions

View File

@@ -379,7 +379,9 @@ const FileExplorerHeader = ({
<DropdownMenuItem key={option.key} onClick={() => snap.setView(option.key)}>
<div className="flex items-center justify-between w-full">
<p>{option.name}</p>
{snap.view === option.key && <Check className="text-brand" strokeWidth={2} />}
{snap.view === option.key && (
<Check size={16} className="text-brand" strokeWidth={2} />
)}
</div>
</DropdownMenuItem>
))}
@@ -391,7 +393,9 @@ const FileExplorerHeader = ({
<DropdownMenuItem key={option.key} onClick={() => setSortBy(option.key)}>
<div className="flex items-center justify-between w-full">
<p>{option.name}</p>
{sortBy === option.key && <Check className="text-brand" strokeWidth={2} />}
{sortBy === option.key && (
<Check size={16} className="text-brand" strokeWidth={2} />
)}
</div>
</DropdownMenuItem>
))}
@@ -405,7 +409,7 @@ const FileExplorerHeader = ({
<div className="flex items-center justify-between w-full">
<p>{option.name}</p>
{sortByOrder === option.key && (
<Check className="text-brand" strokeWidth={2} />
<Check size={16} className="text-brand" strokeWidth={2} />
)}
</div>
</DropdownMenuItem>

View File

@@ -177,17 +177,19 @@ function createStorageExplorerState({
},
sortBy,
setSortBy: (value: STORAGE_SORT_BY) => {
setSortBy: async (value: STORAGE_SORT_BY) => {
state.sortBy = value
state.updateExplorerPreference()
state.setSelectedFilePreview(undefined)
await state.refetchAllOpenedFolders()
},
sortByOrder,
setSortByOrder: (value: STORAGE_SORT_BY_ORDER) => {
setSortByOrder: async (value: STORAGE_SORT_BY_ORDER) => {
state.sortByOrder = value
state.updateExplorerPreference()
state.setSelectedFilePreview(undefined)
await state.refetchAllOpenedFolders()
},
isSearching: false,