Skip to content

Commit

Permalink
Merge pull request #459 from SethFalco/fix-query-params
Browse files Browse the repository at this point in the history
fix: stop double encoding query params
  • Loading branch information
pierotofy committed Jul 8, 2023
2 parents 99ce267 + 97dcb1d commit 57cfdec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libretranslate/templates/app.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ document.addEventListener('DOMContentLoaded', function(){

this.updateQueryParam('source', this.sourceLang)
this.updateQueryParam('target', this.targetLang)
this.updateQueryParam('q', encodeURI(this.inputText))
this.updateQueryParam('q', this.inputText)

if (this.timeout) clearTimeout(this.timeout);
this.timeout = null;
Expand Down Expand Up @@ -470,7 +470,7 @@ function handleLangsResponse(self, response) {
const defaultText = self.getQueryParam("q")

if (defaultText) {
self.inputText = decodeURI(defaultText)
self.inputText = defaultText
self.handleInput(new Event('none'))
}
} else {
Expand Down

0 comments on commit 57cfdec

Please sign in to comment.