@@ -847,38 +847,42 @@ const autocompleteGroup = computed(() => {
847847})
848848
849849const debouncedSearch = useDebounceFn (async (e ) => {
850+ const UNSUPPORTED_ENTITIES = [" validator" ]
851+
850852 const { data } = await search (searchTerm .value .trim ())
851853 if (! data .value .length ) return
852854
855+ const filteredResults = data .value .filter ((item ) => ! UNSUPPORTED_ENTITIES .includes (item .type ))
856+
853857 autocompleteActions .value = []
854- for (let i = 0 ; i < Math .min (3 , data . value .length ); i++ ) {
858+ for (let i = 0 ; i < Math .min (3 , filteredResults .length ); i++ ) {
855859 autocompleteActions .value .push ({
856860 id: id (),
857861 type: " callback" ,
858- icon: data . value [i].type ,
859- title: data . value [i].result .hash ? data . value [i].result .hash : data . value [i].result .name ,
860- subtitle: data . value [i].type .charAt (i).toUpperCase () + data . value [i].type .slice (1 ),
862+ icon: filteredResults [i].type ,
863+ title: filteredResults [i].result .hash ? filteredResults [i].result .hash : filteredResults [i].result .name ,
864+ subtitle: filteredResults [i].type .charAt (i).toUpperCase () + filteredResults [i].type .slice (1 ),
861865 runText: " Open" ,
862866 callback : () => {
863- switch (data . value [i].type ) {
867+ switch (filteredResults [i].type ) {
864868 case " tx" :
865- router .push (` /tx/${ data . value [i].result .hash } ` )
869+ router .push (` /tx/${ filteredResults [i].result .hash } ` )
866870 break
867871
868872 case " block" :
869- router .push (` /block/${ data . value [i].result .height } ` )
873+ router .push (` /block/${ filteredResults [i].result .height } ` )
870874 break
871875
872876 case " namespace" :
873- router .push (` /namespace/${ data . value [i].result .namespace_id } ` )
877+ router .push (` /namespace/${ filteredResults [i].result .namespace_id } ` )
874878 break
875879
876880 case " address" :
877- router .push (` /address/${ data . value [i].result .hash } ` )
881+ router .push (` /address/${ filteredResults [i].result .hash } ` )
878882 break
879883
880884 case " rollup" :
881- router .push (` /rollup/${ data . value [i].result .slug } ` )
885+ router .push (` /rollup/${ filteredResults [i].result .slug } ` )
882886 break
883887
884888 default :
0 commit comments