From c32c6e0363db228044bb7169ac849c32f83583f1 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Fri, 31 Jan 2020 18:25:55 +0530 Subject: [PATCH] :recycle: Refactor --- components/ace-editor.vue | 4 +++- pages/index.vue | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/ace-editor.vue b/components/ace-editor.vue index 5065b7994..d6f14389a 100644 --- a/components/ace-editor.vue +++ b/components/ace-editor.vue @@ -74,7 +74,9 @@ export default { methods: { defineTheme() { - if (this.theme) return this.theme; + if (this.theme) { + return this.theme; + } return ( this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME ); diff --git a/pages/index.vue b/pages/index.vue index f439c03d1..a91a37949 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1884,10 +1884,10 @@ export default { const requestString = []; requestString.push("const xhr = new XMLHttpRequest()"); const user = this.auth === "Basic Auth" ? `'${this.httpUser}'` : null; - const pswd = + const password = this.auth === "Basic Auth" ? `'${this.httpPassword}'` : null; requestString.push( - `xhr.open('${this.method}', '${this.url}${this.pathName}${this.queryString}', true, ${user}, ${pswd})` + `xhr.open('${this.method}', '${this.url}${this.pathName}${this.queryString}', true, ${user}, ${password})` ); if (this.auth === "Bearer Token" || this.auth === "OAuth 2.0") { requestString.push(