update search logic
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user