update search logic

This commit is contained in:
smanylov
2026-03-20 21:37:51 +07:00
parent 7cdcb3a69a
commit 3a3a514825
+15
View File
@@ -74,12 +74,27 @@ export function FileSearchPanel(
if (result?.content?.length) {
setSearchedUserFiles(result.content);
const hasOwned = result?.content.some((item: { owner: boolean }) => {
if (item.owner) {
return true;
}
return false;
});
if (hasOwned) {
if (fileType === 'image') {
setShowGlobalSearch(true);
handlerSearchGlobalFile(fileId, page);
}
}
} else {
setSearchedUserFilesShowNull(true);
if (fileType === 'image') {
setShowGlobalSearch(true);
handlerSearchGlobalFile(fileId, page);
}
}
} catch (error) {