diff --git a/packages/hoppscotch-app/components/collections/Add.vue b/packages/hoppscotch-app/components/collections/Add.vue index 269b75bfa..11fbf4f99 100644 --- a/packages/hoppscotch-app/components/collections/Add.vue +++ b/packages/hoppscotch-app/components/collections/Add.vue @@ -26,6 +26,7 @@ diff --git a/packages/hoppscotch-app/components/collections/my/Request.vue b/packages/hoppscotch-app/components/collections/my/Request.vue index a8f186d60..40b69e167 100644 --- a/packages/hoppscotch-app/components/collections/my/Request.vue +++ b/packages/hoppscotch-app/components/collections/my/Request.vue @@ -126,7 +126,7 @@ :shortcut="['⌫']" @click.native=" () => { - confirmRemove = true + removeRequest() options.tippy().hide() } " @@ -136,12 +136,6 @@ - { const removeRequest = () => { emit("remove-request", { - collectionIndex: props.collectionIndex, - folderName: props.folderName, folderPath: props.folderPath, requestIndex: props.requestIndex, }) diff --git a/packages/hoppscotch-app/components/collections/teams/Collection.vue b/packages/hoppscotch-app/components/collections/teams/Collection.vue index 2e1228325..8b3011fcc 100644 --- a/packages/hoppscotch-app/components/collections/teams/Collection.vue +++ b/packages/hoppscotch-app/components/collections/teams/Collection.vue @@ -157,7 +157,7 @@ :shortcut="['⌫']" @click.native=" () => { - confirmRemove = true + removeCollection() options.tippy().hide() } " @@ -192,7 +192,8 @@ @edit-request="$emit('edit-request', $event)" @select="$emit('select', $event)" @expand-collection="expandCollection" - @remove-request="removeRequest" + @remove-request="$emit('remove-request', $event)" + @remove-folder="$emit('remove-folder', $event)" @duplicate-request="$emit('duplicate-request', $event)" />
- @@ -292,7 +287,6 @@ export default defineComponent({ showChildren: false, dragging: false, selectedFolder: {}, - confirmRemove: false, prevCursor: "", cursor: "", pageNo: 0, @@ -375,7 +369,6 @@ export default defineComponent({ }, removeCollection() { this.$emit("remove-collection", { - collectionsType: this.collectionsType, collectionIndex: this.collectionIndex, collectionID: this.collection.id, }) @@ -393,13 +386,6 @@ export default defineComponent({ if (E.isLeft(moveRequestResult)) this.$toast.error(`${this.$t("error.something_went_wrong")}`) }, - removeRequest({ collectionIndex, folderName, requestIndex }: any) { - this.$emit("remove-request", { - collectionIndex, - folderName, - requestIndex, - }) - }, }, }) diff --git a/packages/hoppscotch-app/components/collections/teams/Folder.vue b/packages/hoppscotch-app/components/collections/teams/Folder.vue index 61d2de453..099675d94 100644 --- a/packages/hoppscotch-app/components/collections/teams/Folder.vue +++ b/packages/hoppscotch-app/components/collections/teams/Folder.vue @@ -130,7 +130,7 @@ :shortcut="['⌫']" @click.native=" () => { - confirmRemove = true + removeFolder() options.tippy().hide() } " @@ -165,7 +165,8 @@ @update-team-collections="$emit('update-team-collections')" @select="$emit('select', $event)" @expand-collection="expandCollection" - @remove-request="removeRequest" + @remove-request="$emit('remove-request', $event)" + @remove-folder="$emit('remove-folder', $event)" @duplicate-request="$emit('duplicate-request', $event)" />
- diff --git a/packages/hoppscotch-app/components/collections/teams/Request.vue b/packages/hoppscotch-app/components/collections/teams/Request.vue index ad33ee0e6..40c0ed124 100644 --- a/packages/hoppscotch-app/components/collections/teams/Request.vue +++ b/packages/hoppscotch-app/components/collections/teams/Request.vue @@ -123,7 +123,7 @@ :shortcut="['⌫']" @click.native=" () => { - confirmRemove = true + removeRequest() options.tippy().hide() } " @@ -133,12 +133,6 @@ - { const removeRequest = () => { emit("remove-request", { - collectionIndex: props.collectionIndex, - folderName: props.folderName, + folderPath: props.folderName, requestIndex: props.requestIndex, }) } diff --git a/packages/hoppscotch-app/components/smart/ConfirmModal.vue b/packages/hoppscotch-app/components/smart/ConfirmModal.vue index 122e0a7c3..24ef7b170 100644 --- a/packages/hoppscotch-app/components/smart/ConfirmModal.vue +++ b/packages/hoppscotch-app/components/smart/ConfirmModal.vue @@ -16,7 +16,12 @@ @@ -42,14 +47,15 @@ export default defineComponent({ return this.$t("action.no") }, }, + loadingState: { type: Boolean, default: null }, }, methods: { hideModal() { this.$emit("hide-modal") }, resolve() { - this.$emit("resolve") - this.$emit("hide-modal") + this.$emit("resolve", this.title) + if (this.loadingState === null) this.$emit("hide-modal") }, }, })