1
0
Mirror von https://github.com/karl0ss/homepage.git synchronisiert 2025-11-24 12:04:29 +00:00

Fix: fix custom quicklaunch search without search widget (#5003)

Dieser Commit ist enthalten in:
shamoon 2025-03-16 13:12:20 -07:00 committet von GitHub
Ursprung 5ea46881ee
Commit 5f19e4af91
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -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) {