Procházet zdrojové kódy

lint support custom search provider in quicklaunch

shamoon před 2 roky
rodič
revize
046f2986a8
1 změnil soubory, kde provedl 5 přidání a 7 odebrání
  1. 5 7
      src/pages/index.jsx

+ 5 - 7
src/pages/index.jsx

@@ -200,14 +200,12 @@ function Home({ initialSettings }) {
     if (Array.isArray(searchWidget.options?.provider)) {
     if (Array.isArray(searchWidget.options?.provider)) {
       // if search provider is a list, try to retrieve from localstorage, fall back to the first
       // if search provider is a list, try to retrieve from localstorage, fall back to the first
       searchProvider = getStoredProvider() ?? searchProviders[searchWidget.options.provider[0]];
       searchProvider = getStoredProvider() ?? searchProviders[searchWidget.options.provider[0]];
-    } else {
-      if (searchWidget.options?.provider === 'custom') {
-        searchProvider = {
-          url: searchWidget.options.url
-        }
-      } else {
-        searchProvider = searchProviders[searchWidget.options?.provider];
+    } else if (searchWidget.options?.provider === 'custom') {
+      searchProvider = {
+        url: searchWidget.options.url
       }
       }
+    } else {
+      searchProvider = searchProviders[searchWidget.options?.provider];
     }
     }
   }
   }