mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Fix: fix custom quicklaunch search without search widget (#5003)
This commit is contained in:
parent
5ea46881ee
commit
5f19e4af91
@ -1,5 +1,6 @@
|
||||
import { searchProviders } from "components/widgets/search/search";
|
||||
|
||||
import { getSettings } from "utils/config/config";
|
||||
import cachedFetch from "utils/proxy/cached-fetch";
|
||||
import { widgetsFromConfig } from "utils/config/widget-helpers";
|
||||
|
||||
@ -12,8 +13,16 @@ export default async function handler(req, res) {
|
||||
const widgets = await widgetsFromConfig();
|
||||
const searchWidget = widgets.find((w) => w.type === "search");
|
||||
|
||||
provider.url = searchWidget.options.url;
|
||||
provider.suggestionUrl = searchWidget.options.suggestionUrl;
|
||||
if (searchWidget) {
|
||||
provider.url = searchWidget.options.url;
|
||||
provider.suggestionUrl = searchWidget.options.suggestionUrl;
|
||||
} else {
|
||||
const settings = getSettings();
|
||||
if (settings.quicklaunch && settings.quicklaunch.provider === "custom") {
|
||||
provider.url = settings.quicklaunch.url;
|
||||
provider.suggestionUrl = settings.quicklaunch.suggestionUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!provider.suggestionUrl) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user