Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

Switch to semantic if checks

Dmitry Yankowskif36b91c3cc4d
diff --git a/pages/graphql.vue b/pages/graphql.vue
index 3ee2ba047..a11888ba5 100644
--- a/pages/graphql.vue
+++ b/pages/graphql.vue
@@ -489,7 +489,7 @@ export default {
this.$nuxt.$loading.start()
this.response = this.$t("loading")
- this.settings.SCROLL_INTO_ENABLED && this.scrollInto("response")
+ if (this.settings.SCROLL_INTO_ENABLED) this.scrollInto("response")
try {
let headers = {}
@@ -537,7 +537,7 @@ export default {
this.$nuxt.$loading.start()
this.schema = this.$t("loading")
- this.settings.SCROLL_INTO_ENABLED && this.scrollInto("schema")
+ if (this.settings.SCROLL_INTO_ENABLED) this.scrollInto("schema")
try {
const query = JSON.stringify({
diff --git a/pages/index.vue b/pages/index.vue
index 9626c78cc..de7536cd2 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -1976,7 +1976,7 @@ export default {
this.path = path
this.showPreRequestScript = usesScripts
this.preRequestScript = preRequestScript
- this.settings.SCROLL_INTO_ENABLED && this.scrollInto("request")
+ if (this.settings.SCROLL_INTO_ENABLED) this.scrollInto("request")
},
getVariablesFromPreRequestScript() {
if (!this.preRequestScript) {
@@ -2012,7 +2012,7 @@ export default {
},
async sendRequest() {
this.$toast.clear()
- this.settings.SCROLL_INTO_ENABLED && this.scrollInto("response")
+ if (this.settings.SCROLL_INTO_ENABLED) this.scrollInto("response")
if (!this.isValidURL) {
this.$toast.error(this.$t("url_invalid_format"), {