mirror of
https://github.com/mue/mue.git
synced 2026-06-08 14:10:42 +02:00
fix: voice search no longer redirects on empty and now has reload warning
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
|
||||
.micIcon {
|
||||
margin-right: 10px;
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
.dark .searchBar {
|
||||
|
||||
Reference in New Issue
Block a user