mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 06:08:48 +00:00
Fix: fix custom quicklaunch search without search widget (#5003)
This commit is contained in:
parent
5ea46881ee
commit
5f19e4af91
1 changed files with 11 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue