fix: stop double encoding query params

This commit is contained in:
Seth Falco 2023-07-08 04:48:26 +01:00
parent abc77002e2
commit 97dcb1decc
No known key found for this signature in database
GPG key ID: DE1C217EFF01FEC8

View file

@ -206,7 +206,7 @@ document.addEventListener('DOMContentLoaded', function(){
this.updateQueryParam('source', this.sourceLang) this.updateQueryParam('source', this.sourceLang)
this.updateQueryParam('target', this.targetLang) this.updateQueryParam('target', this.targetLang)
this.updateQueryParam('q', encodeURI(this.inputText)) this.updateQueryParam('q', this.inputText)
if (this.timeout) clearTimeout(this.timeout); if (this.timeout) clearTimeout(this.timeout);
this.timeout = null; this.timeout = null;
@ -464,7 +464,7 @@ function handleLangsResponse(self, response) {
const defaultText = self.getQueryParam("q") const defaultText = self.getQueryParam("q")
if (defaultText) { if (defaultText) {
self.inputText = decodeURI(defaultText) self.inputText = defaultText
self.handleInput(new Event('none')) self.handleInput(new Event('none'))
} }
} else { } else {