lint: fix sonarjs/no-dead-store issues (#23653)
This commit is contained in:
@@ -51,7 +51,6 @@ const Apps = ({
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
const [currentType, setCurrentType] = useState<string>('')
|
||||
const [currCategory, setCurrCategory] = useTabSearchParams({
|
||||
defaultTab: allCategoriesEn,
|
||||
disableSearchParams: false,
|
||||
@@ -74,28 +73,7 @@ const Apps = ({
|
||||
},
|
||||
)
|
||||
|
||||
const filteredList = useMemo(() => {
|
||||
if (currCategory === allCategoriesEn) {
|
||||
if (!currentType)
|
||||
return allList
|
||||
else if (currentType === 'chatbot')
|
||||
return allList.filter(item => (item.app.mode === 'chat' || item.app.mode === 'advanced-chat'))
|
||||
else if (currentType === 'agent')
|
||||
return allList.filter(item => (item.app.mode === 'agent-chat'))
|
||||
else
|
||||
return allList.filter(item => (item.app.mode === 'workflow'))
|
||||
}
|
||||
else {
|
||||
if (!currentType)
|
||||
return allList.filter(item => item.category === currCategory)
|
||||
else if (currentType === 'chatbot')
|
||||
return allList.filter(item => (item.app.mode === 'chat' || item.app.mode === 'advanced-chat') && item.category === currCategory)
|
||||
else if (currentType === 'agent')
|
||||
return allList.filter(item => (item.app.mode === 'agent-chat') && item.category === currCategory)
|
||||
else
|
||||
return allList.filter(item => (item.app.mode === 'workflow') && item.category === currCategory)
|
||||
}
|
||||
}, [currentType, currCategory, allCategoriesEn, allList])
|
||||
const filteredList = allList.filter(item => currCategory === allCategoriesEn || item.category === currCategory)
|
||||
|
||||
const searchFilteredList = useMemo(() => {
|
||||
if (!searchKeywords || !filteredList || filteredList.length === 0)
|
||||
|
@@ -49,7 +49,6 @@ const SideBar: FC<IExploreSideBarProps> = ({
|
||||
const segments = useSelectedLayoutSegments()
|
||||
const lastSegment = segments.slice(-1)[0]
|
||||
const isDiscoverySelected = lastSegment === 'apps'
|
||||
const isChatSelected = lastSegment === 'chat'
|
||||
const { installedApps, setInstalledApps, setIsFetchingInstalledApps } = useContext(ExploreContext)
|
||||
const { isFetching: isFetchingInstalledApps, data: ret, refetch: fetchInstalledAppList } = useGetInstalledApps()
|
||||
const { mutateAsync: uninstallApp } = useUninstallApp()
|
||||
|
Reference in New Issue
Block a user