fix: don't update url after character-limit

This commit is contained in:
Seth Falco 2023-07-08 03:34:53 +01:00
parent d69bbb326c
commit 4f6145e275
No known key found for this signature in database
GPG key ID: DE1C217EFF01FEC8
3 changed files with 22 additions and 20 deletions

View file

@ -25,7 +25,7 @@ document.addEventListener('DOMContentLoaded', function(){
translatedText: "",
output: "",
charactersLimit: -1,
detectedLangText: "",
copyTextLabel: {{ _e("Copy text") }},
@ -108,10 +108,6 @@ document.addEventListener('DOMContentLoaded', function(){
}
}
if (this.charactersLimit !== -1 && this.inputText.length >= this.charactersLimit){
this.inputText = this.inputText.substring(0, this.charactersLimit);
}
// Update "selected" attribute (to overcome a vue.js limitation)
// but properly display checkmarks on supported browsers.
// Also change the <select> width value depending on the <option> length
@ -212,7 +208,7 @@ document.addEventListener('DOMContentLoaded', function(){
this.timeout = null;
this.detectedLangText = "";
if (this.inputText === ""){
this.translatedText = "";
this.output = "";
@ -247,7 +243,7 @@ document.addEventListener('DOMContentLoaded', function(){
if (self.refreshOnce()) return;
}
{% endif %}
var res = JSON.parse(this.response);
// Success!
if (res.translatedText !== undefined){