mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-06 12:18:48 +00:00
Enhancement: separate Internet search settings for quicklaunch (#3541)
--------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
a53b042fec
commit
48170fe899
3 changed files with 53 additions and 42 deletions
|
@ -26,7 +26,6 @@ import { bookmarksResponse, servicesResponse, widgetsResponse } from "utils/conf
|
|||
import ErrorBoundary from "components/errorboundry";
|
||||
import themes from "utils/styles/themes";
|
||||
import QuickLaunch from "components/quicklaunch";
|
||||
import { getStoredProvider, searchProviders } from "components/widgets/search/search";
|
||||
|
||||
const ThemeToggle = dynamic(() => import("components/toggles/theme"), {
|
||||
ssr: false,
|
||||
|
@ -204,20 +203,6 @@ function Home({ initialSettings }) {
|
|||
|
||||
const [searching, setSearching] = useState(false);
|
||||
const [searchString, setSearchString] = useState("");
|
||||
let searchProvider = null;
|
||||
const searchWidget = Object.values(widgets).find((w) => w.type === "search");
|
||||
if (searchWidget) {
|
||||
if (Array.isArray(searchWidget.options?.provider)) {
|
||||
// if search provider is a list, try to retrieve from localstorage, fall back to the first
|
||||
searchProvider = getStoredProvider() ?? searchProviders[searchWidget.options.provider[0]];
|
||||
} else if (searchWidget.options?.provider === "custom") {
|
||||
searchProvider = searchWidget.options;
|
||||
} else {
|
||||
searchProvider = searchProviders[searchWidget.options?.provider];
|
||||
}
|
||||
// to pass to quicklaunch
|
||||
searchProvider.showSearchSuggestions = searchWidget.options?.showSearchSuggestions;
|
||||
}
|
||||
const headerStyle = settings?.headerStyle || "underlined";
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -404,7 +389,6 @@ function Home({ initialSettings }) {
|
|||
setSearchString={setSearchString}
|
||||
isOpen={searching}
|
||||
close={setSearching}
|
||||
searchProvider={settings.quicklaunch?.hideInternetSearch ? null : searchProvider}
|
||||
/>
|
||||
<div
|
||||
id="information-widgets"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue