fix: voice search no longer redirects on empty and now has reload warning

This commit is contained in:
David Ralph
2021-06-21 13:13:16 +01:00
parent aad568bd28
commit 5b00b3d859
3 changed files with 6 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ export default class SearchSettings extends React.PureComponent {
<>
<h2>{search.title}</h2>
<Switch name='searchBar' text={language.enabled} category='widgets' />
{isChrome ? <Checkbox name='voiceSearch' text={search.voice_search} /> : null}
{isChrome ? <Checkbox name='voiceSearch' text={search.voice_search} category='search' element='.other' /> : null}
<Dropdown label={search.search_engine} name='searchEngine' onChange={(value) => this.setSearchEngine(value)}>
{searchEngines.map((engine) => (
<option key={engine.name} value={engine.settingsName}>{engine.name}</option>

View File

@@ -39,6 +39,10 @@ export default class Search extends React.PureComponent {
};
voiceSearch.onend = () => {
if (searchText.value === '') {
return;
}
setTimeout(() => {
window.location.href = this.state.url + `?${this.state.query}=` + searchText.value;
}, 1000);

View File

@@ -51,6 +51,7 @@
.micIcon {
margin-right: 10px;
position: relative !important;
}
.dark .searchBar {