diff --git a/components/environments/Edit.vue b/components/environments/Edit.vue
index 5919d8e94..72656b70d 100644
--- a/components/environments/Edit.vue
+++ b/components/environments/Edit.vue
@@ -28,7 +28,7 @@
class="icon button"
@click="clearContent($event)"
>
- clear_all
+ {{ clearIcon }}
@@ -118,7 +118,7 @@ export default Vue.extend({
return {
name: null as string | null,
vars: [] as { key: string; value: string }[],
- doneButton: 'done',
+ clearIcon: "clear_all",
}
},
watch: {
@@ -132,17 +132,13 @@ export default Vue.extend({
},
},
methods: {
- clearContent({ target }: { target: HTMLElement }) {
+ clearContent() {
this.vars = []
-
- target.innerHTML = this.doneButton
+ this.clearIcon = "done"
this.$toast.info(this.$t("cleared").toString(), {
icon: "clear_all",
})
- setTimeout(
- () => (target.innerHTML = 'clear_all'),
- 1000
- )
+ setTimeout(() => (this.clearIcon = "clear_all"), 1000)
},
addEnvironmentVariable() {
this.vars.push({
diff --git a/components/http/CodegenModal.vue b/components/http/CodegenModal.vue
index cfdb526d1..015dc9b9c 100644
--- a/components/http/CodegenModal.vue
+++ b/components/http/CodegenModal.vue
@@ -48,7 +48,7 @@
class="icon button"
@click="copyRequestCode"
>
- content_copy
+ {{ copyIcon }}
@@ -84,8 +84,7 @@ export default {
data() {
return {
codegens,
- copyButton: 'content_copy',
- doneButton: 'done',
+ copyIcon: "content_copy",
}
},
computed: {
@@ -106,17 +105,14 @@ export default {
this.$emit("handle-import")
},
copyRequestCode() {
- this.$refs.copyRequestCode.innerHTML = this.doneButton
- this.$toast.success(this.$t("copied_to_clipboard"), {
- icon: "done",
- })
this.$refs.generatedCode.editor.selectAll()
this.$refs.generatedCode.editor.focus()
document.execCommand("copy")
- setTimeout(
- () => (this.$refs.copyRequestCode.innerHTML = this.copyButton),
- 1000
- )
+ this.copyIcon = "done"
+ this.$toast.success(this.$t("copied_to_clipboard"), {
+ icon: "done",
+ })
+ setTimeout(() => (this.copyIcon = "content_copy"), 1000)
},
},
}
diff --git a/components/http/RawBody.vue b/components/http/RawBody.vue
index c0c7a7404..072ef00fb 100644
--- a/components/http/RawBody.vue
+++ b/components/http/RawBody.vue
@@ -12,7 +12,7 @@
class="icon button"
@click="prettifyRequestBody"
>
- photo_filter
+ {{ prettifyIcon }}