No reason to be a separate method
This commit is contained in:
parent
a54f618dfd
commit
2df798834b
@ -22,9 +22,8 @@ export default function QuickLaunch({ servicesAndBookmarks, searchString, setSea
|
|||||||
const [searchSuggestions, setSearchSuggestions] = useState([]);
|
const [searchSuggestions, setSearchSuggestions] = useState([]);
|
||||||
|
|
||||||
const { data: widgets } = useSWR("/api/widgets");
|
const { data: widgets } = useSWR("/api/widgets");
|
||||||
|
|
||||||
function getSearchProvider() {
|
|
||||||
const searchWidget = Object.values(widgets).find((w) => w.type === "search");
|
const searchWidget = Object.values(widgets).find((w) => w.type === "search");
|
||||||
|
|
||||||
let searchProvider;
|
let searchProvider;
|
||||||
|
|
||||||
if (settings?.quicklaunch?.provider === "custom" && settings?.quicklaunch?.url?.length > 0) {
|
if (settings?.quicklaunch?.provider === "custom" && settings?.quicklaunch?.url?.length > 0) {
|
||||||
@ -52,11 +51,6 @@ export default function QuickLaunch({ servicesAndBookmarks, searchString, setSea
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
return searchProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
const searchProvider = settings?.quicklaunch?.hideInternetSearch === false ? null : getSearchProvider();
|
|
||||||
|
|
||||||
function openCurrentItem(newWindow) {
|
function openCurrentItem(newWindow) {
|
||||||
const result = results[currentItemIndex];
|
const result = results[currentItemIndex];
|
||||||
window.open(
|
window.open(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user