From 810ea969d9639571e8209fd0f8f94026095f94dc Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sat, 21 Jan 2023 11:52:19 +0000 Subject: [PATCH] fix: custom search dropdown error --- README.md | 2 -- src/components/widgets/search/Search.jsx | 12 ++++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fdf2124b..cdd4846b 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ Mue is a fast, open and free-to-use browser extension that gives a new, fresh an
## Table of contents - -- [NOTICE](#notice) - [Table of contents](#table-of-contents) - [Screenshots](#screenshots) - [Features](#features) diff --git a/src/components/widgets/search/Search.jsx b/src/components/widgets/search/Search.jsx index d82b6b49..a1be54fb 100644 --- a/src/components/widgets/search/Search.jsx +++ b/src/components/widgets/search/Search.jsx @@ -89,7 +89,10 @@ export default class Search extends PureComponent { } if (setting === 'custom') { - url = localStorage.getItem('customSearchEngine'); + const custom = localStorage.getItem('customSearchEngine'); + if (custom !== null) { + url = custom; + } } if (localStorage.getItem('voiceSearch') === 'true') { @@ -121,7 +124,12 @@ export default class Search extends PureComponent { } if (custom) { - url = localStorage.getItem('customSearchEngine'); + const customSetting = localStorage.getItem('customSearchEngine'); + if (customSetting !== null) { + url = customSetting; + } else { + url = this.state.url; + } } this.setState({