Skip to content

Commit

Permalink
fix bugs with incomplete default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Sep 5, 2023
1 parent ed348da commit 7cbedd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/Setup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
//load settings from local storage
const storedSettings: ISettings = JSON.parse(localStorage.getItem('settings') ?? '{}');
if (storedSettings) {
preferredSearchEngine.set(storedSettings.preferredSearchEngine);
expandAdvancedOptionsByDefault.set(storedSettings.expandAdvancedOptionsByDefault);
expandStatsByDefault.set(storedSettings.expandStatsByDefault);
preferredSearchEngine.set(storedSettings.preferredSearchEngine ?? 'Google');
expandAdvancedOptionsByDefault.set(storedSettings.expandAdvancedOptionsByDefault ?? false);
expandStatsByDefault.set(storedSettings.expandStatsByDefault ?? true);
statUnits.set(storedSettings.statUnits ?? 'Imperial');
inputUnits.set(storedSettings.inputUnits ?? 'Imperial');
theme.set(storedSettings.theme ?? 'dark');
Expand Down
11 changes: 6 additions & 5 deletions src/lib/utils/searchEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ export const performSearch = (searchEngine: string, monitor: IMonitor) => {
let searchUrl = '';

//url based on search engine chosen
if (searchEngine === 'Google') searchUrl = 'https://www.google.com/search?q=';
if (searchEngine === 'Bing') searchUrl = 'https://www.bing.com/search?q=';
if (searchEngine === 'DuckDuckGo') searchUrl = 'https://www.duckduckgo.com/?q=';
if (searchEngine === 'Amazon') searchUrl = 'https://www.amazon.com/s?k=';
if (searchEngine === 'Newegg') searchUrl = 'https://www.newegg.com/p/pl?d=';
if (searchEngine === 'Best Buy') searchUrl = 'https://www.bestbuy.com/site/searchpage.jsp?st=';
else if (searchEngine === 'DuckDuckGo') searchUrl = 'https://www.duckduckgo.com/?q=';
else if (searchEngine === 'Amazon') searchUrl = 'https://www.amazon.com/s?k=';
else if (searchEngine === 'Newegg') searchUrl = 'https://www.newegg.com/p/pl?d=';
else if (searchEngine === 'Best Buy')
searchUrl = 'https://www.bestbuy.com/site/searchpage.jsp?st=';
else searchUrl = 'https://www.google.com/search?q=';

//base search string
searchUrl += 'monitor';
Expand Down

0 comments on commit 7cbedd1

Please sign in to comment.