mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-17 13:06:21 +00:00
🐛 fix: fix search web-browsing display bug (#6653)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user