🐛 fix: fix search web-browsing display bug (#6653)

This commit is contained in:
Arvin Xu
2025-03-03 17:22:00 +08:00
committed by GitHub
parent 53f20f511f
commit f4726438da
2 changed files with 16 additions and 1 deletions
@@ -41,6 +41,18 @@ describe('builtinToolSelectors', () => {
]);
});
it('should hide tool when not need visible with hidden', () => {
const state = {
...initialState,
builtinTools: [
{ identifier: 'tool-1', hidden: true, manifest: { meta: { title: 'Tool 1' } } },
{ identifier: DalleManifest.identifier, manifest: { meta: { title: 'Dalle' } } },
],
} as ToolStoreState;
const result = builtinToolSelectors.metaList(false)(state);
expect(result).toEqual([]);
});
it('should return an empty list if no builtin tools are available', () => {
const state: ToolStoreState = {
...initialState,
+4 -1
View File
@@ -7,7 +7,10 @@ const metaList =
(showDalle?: boolean) =>
(s: ToolStoreState): LobeToolMeta[] =>
s.builtinTools
.filter((item) => (!showDalle ? item.identifier !== DalleManifest.identifier : !item.hidden))
.filter(
(item) =>
!item.hidden && (!showDalle ? item.identifier !== DalleManifest.identifier : true),
)
.map((t) => ({
author: 'LobeHub',
identifier: t.identifier,