Skip to content

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

fix: proper implementation of isCustomMethod

Andrew Bastin846c1426cf1d
diff --git a/components/http/Request.vue b/components/http/Request.vue
index afb3ed7f5..4401e9e57 100644
--- a/components/http/Request.vue
+++ b/components/http/Request.vue
@@ -28,7 +28,7 @@
focus:border-accent focus:outline-none
"
:value="newMethod"
- :readonly="isCustomMethod()"
+ :readonly="!isCustomMethod"
@input="onSelectMethod($event.target.value)"
/>
</template>
@@ -205,6 +205,7 @@
<script lang="ts">
import {
+ computed,
defineComponent,
ref,
useContext,
@@ -383,11 +384,9 @@ export default defineComponent({
defineActionHandler("request.method.delete", () => updateMethod("DELETE"))
defineActionHandler("request.method.head", () => updateMethod("HEAD"))
- const isCustomMethod = () => {
- if (newMethod.value === "CUSTOM" || !methods.includes(newMethod.value))
- return false
- return true
- }
+ const isCustomMethod = computed(() => {
+ return newMethod.value === "CUSTOM" || !methods.includes(newMethod.value)
+ })
return {
newEndpoint,