diff --git a/src/components/modals/Update.jsx b/src/components/modals/Update.jsx
index ad249295..8536a4a9 100644
--- a/src/components/modals/Update.jsx
+++ b/src/components/modals/Update.jsx
@@ -15,13 +15,6 @@ export default class Update extends React.PureComponent {
}
async getUpdate() {
- if (localStorage.getItem('offlineMode') === 'true') {
- return this.setState({
- title: this.props.language.offline.title,
- html: this.props.language.offline.description
- });
- }
-
const data = await (await fetch(Constants.API_URL + '/getUpdate')).json();
if (data.statusCode === 500 || data.title === null) {
@@ -42,7 +35,14 @@ export default class Update extends React.PureComponent {
}
componentDidMount() {
- this.getUpdate();
+ if (localStorage.getItem('offlineMode') === 'true') {
+ return this.setState({
+ title: this.props.language.offline.title,
+ html: this.props.language.offline.description
+ });
+ }
+
+ this.getUpdate();
}
render() {
diff --git a/src/components/modals/settings/sections/BackgroundSettings.jsx b/src/components/modals/settings/sections/BackgroundSettings.jsx
index 0076bb22..c68294a7 100644
--- a/src/components/modals/settings/sections/BackgroundSettings.jsx
+++ b/src/components/modals/settings/sections/BackgroundSettings.jsx
@@ -230,7 +230,6 @@ export default class BackgroundSettings extends React.PureComponent {
-
searchText.value = event.results[0][0].transcript;
+
+ voiceSearch.onresult = (event) => {
+ searchText.value = event.results[0][0].transcript;
+ }
+
voiceSearch.onend = () =>{
setTimeout(() => {
window.location.href = this.state.url + `?${this.state.query}=` + searchText.value;
@@ -28,9 +34,11 @@ export default class Search extends React.PureComponent {
}
}
- render() {
+
+ componentDidMount() {
let url;
let query = 'q';
+ let microphone = null;
const setting = localStorage.getItem('searchEngine');
const info = searchEngines.find(i => i.settingsName === setting);
@@ -44,27 +52,24 @@ export default class Search extends React.PureComponent {
url = localStorage.getItem('customSearchEngine');
}
- const searchButton = () => {
- const value = document.getElementById('searchtext').value || 'mue fast';
- window.location.href = url + `?${query}=` + value;
- };
-
- let microphone = null;
if (localStorage.getItem('voiceSearch') === 'true') {
- this.setState({
- url: url,
- query: query
- });
microphone = this.startSpeechRecognition()}/>;
}
+ this.setState({
+ url: url,
+ query: query,
+ microphone: microphone
+ });
+ }
+
+ render() {
return (
);
diff --git a/src/translations/en.json b/src/translations/en.json
index f28a3562..bcb579d6 100644
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -76,7 +76,6 @@
"custom_css": "Custom CSS",
"experimental": {
"title": "Experimental",
- "webp": "Enable WebP",
"animations": "Animations",
"voice_search": "Voice Search",
"night_mode": "Automatic Night Mode"
diff --git a/src/translations/es.json b/src/translations/es.json
index 3b96bf14..d9988a69 100644
--- a/src/translations/es.json
+++ b/src/translations/es.json
@@ -60,7 +60,6 @@
"dark": "Tema Oscuro",
"experimental": {
"title": "Experimental",
- "webp": "Activar WebP",
"animations": "Animaciones",
"voicesearch": "Búsqueda por voz",
"nightmode": "Modo nocturno automático"
diff --git a/src/translations/fr.json b/src/translations/fr.json
index 813645f3..acf645cd 100644
--- a/src/translations/fr.json
+++ b/src/translations/fr.json
@@ -59,7 +59,6 @@
"dark": "Thème sombre",
"experimental": {
"title": "Expérimental",
- "webp": "Activer WebP",
"animations": "Animations",
"favourite": "Bouton Ajouter aux favoris",
"voice_search": "Recherche vocale"
diff --git a/src/translations/nl.json b/src/translations/nl.json
index 37db98d4..45294502 100644
--- a/src/translations/nl.json
+++ b/src/translations/nl.json
@@ -52,7 +52,6 @@
"dark": "Donker Thema",
"experimental": {
"title": "Experimenteel",
- "webp": "WebP Gebruiken",
"animations": "Animaties"
},
"language": "Taal",
diff --git a/src/translations/no.json b/src/translations/no.json
index 9f0e31e9..e69764d4 100644
--- a/src/translations/no.json
+++ b/src/translations/no.json
@@ -51,7 +51,6 @@
"dark": "Mørkt tema",
"experimental": {
"title": "Eksperimental",
- "webp": "Skru på WebP",
"animations": "Animasjoner"
},
"language": "Språk",
diff --git a/src/translations/ru.json b/src/translations/ru.json
index eb4494ab..21110694 100644
--- a/src/translations/ru.json
+++ b/src/translations/ru.json
@@ -60,7 +60,6 @@
"dark": "Тёмная тема",
"experimental": {
"title": "Экспериментальные настройки",
- "webp": "Включить WebP",
"animations": "Анимации",
"voicesearch": "Поиск голосом",
"nightmode": "Автоматический ночной режим"