♻️ Refactoring code

This commit is contained in:
Liyas Thomas
2019-11-25 05:44:44 +05:30
parent 0383403cce
commit a17239ca31
6 changed files with 15 additions and 15 deletions

View File

@@ -1231,7 +1231,7 @@ export default {
);
}
if (this.headers) {
this.headers.forEach(function(element) {
this.headers.forEach((element) => {
requestString.push(
"xhr.setRequestHeader('" +
element.key +
@@ -1288,7 +1288,7 @@ export default {
);
}
if (this.headers) {
this.headers.forEach(function(element) {
this.headers.forEach((element) => {
headers.push(
' "' + element.key + '": "' + element.value + '",\n'
);
@@ -1326,7 +1326,7 @@ export default {
);
}
if (this.headers) {
this.headers.forEach(function(element) {
this.headers.forEach((element) => {
requestString.push(
" -H '" + element.key + ": " + element.value + "' \\\n"
);
@@ -1966,7 +1966,7 @@ export default {
uploadPayload() {
this.rawInput = true;
let file = this.$refs.payload.files[0];
if (file != null) {
if (file !== null) {
let reader = new FileReader();
reader.onload = e => {
this.rawParams = e.target.result;

View File

@@ -295,7 +295,7 @@ export default {
}
},
disconnect() {
if (this.socket !== null) this.socket.close();
this.socket.close();
},
handleError(error) {
this.disconnect();

View File

@@ -244,7 +244,7 @@ export default {
},
setActiveColor(color, vibrant) {
// By default, the color is vibrant.
if (vibrant == null) vibrant = true;
if (vibrant === null) vibrant = true;
document.documentElement.style.setProperty("--ac-color", color);
document.documentElement.style.setProperty(
"--act-color",