diff --git a/packages/hoppscotch-app/components/collections/index.vue b/packages/hoppscotch-app/components/collections/index.vue
index f1f5f1f80..1ecedf5a3 100644
--- a/packages/hoppscotch-app/components/collections/index.vue
+++ b/packages/hoppscotch-app/components/collections/index.vue
@@ -80,6 +80,7 @@
:save-request="saveRequest"
:collections-type="collectionsType"
:picked="picked"
+ :loading-collection-i-ds="loadingCollectionIDs"
@edit-collection="editCollection(collection, index)"
@add-folder="addFolder($event)"
@edit-folder="editFolder($event)"
@@ -95,7 +96,14 @@
/>
![]()
{
this.teamCollectionsNew = cloneDeep(colls)
})
+ this.subscribeTo(
+ this.teamCollectionAdapter.loadingCollections$,
+ (collectionsIDs) => {
+ console.log("loading collections", collectionsIDs)
+ this.loadingCollectionIDs = collectionsIDs
+ }
+ )
},
methods: {
updateTeamCollections() {
diff --git a/packages/hoppscotch-app/components/collections/teams/Collection.vue b/packages/hoppscotch-app/components/collections/teams/Collection.vue
index e370cd049..c5168434c 100644
--- a/packages/hoppscotch-app/components/collections/teams/Collection.vue
+++ b/packages/hoppscotch-app/components/collections/teams/Collection.vue
@@ -146,6 +146,7 @@
:collections-type="collectionsType"
:is-filtered="isFiltered"
:picked="picked"
+ :loading-collection-i-ds="loadingCollectionIDs"
@add-folder="$emit('add-folder', $event)"
@edit-folder="$emit('edit-folder', $event)"
@edit-request="$emit('edit-request', $event)"
@@ -173,7 +174,14 @@
@duplicate-request="$emit('duplicate-request', $event)"
/>
+
+ {{ $t("state.loading") }}
+
+
+
+ {{ $t("state.loading") }}
+
+
{} },
picked: { type: Object, default: () => {} },
+ loadingCollectionIDs: { type: Array, default: () => [] },
},
setup() {
return {
diff --git a/packages/hoppscotch-app/components/teams/Add.vue b/packages/hoppscotch-app/components/teams/Add.vue
index 505d528a0..ef5daf13c 100644
--- a/packages/hoppscotch-app/components/teams/Add.vue
+++ b/packages/hoppscotch-app/components/teams/Add.vue
@@ -19,7 +19,11 @@
-
+
(null)
-const addNewTeam = () =>
- pipe(
- TeamNameCodec.decode(name.value), // Perform decode (returns either)
- TE.fromEither, // Convert either to a task either
- TE.mapLeft(() => "invalid_name" as const), // Failure above is an invalid_name, give it an identifiable value
- TE.chainW(createTeam), // Create the team
+const isLoading = ref(false)
+
+const addNewTeam = async () => {
+ isLoading.value = true
+ await pipe(
+ TeamNameCodec.decode(name.value),
+ TE.fromEither,
+ TE.mapLeft(() => "invalid_name" as const),
+ TE.chainW(createTeam),
TE.match(
(err) => {
// err is of type "invalid_name" | GQLError
@@ -72,6 +79,8 @@ const addNewTeam = () =>
}
)
)()
+ isLoading.value = false
+}
const hideModal = () => {
name.value = null
diff --git a/packages/hoppscotch-app/components/teams/Edit.vue b/packages/hoppscotch-app/components/teams/Edit.vue
index 8091026d1..0f602e0d4 100644
--- a/packages/hoppscotch-app/components/teams/Edit.vue
+++ b/packages/hoppscotch-app/components/teams/Edit.vue
@@ -175,7 +175,11 @@
-
+
{
return []
})
+const isLoading = ref(false)
+
const removeExistingTeamMember = async (userID: string) => {
+ isLoading.value = true
const removeTeamMemberResult = await removeTeamMember(
userID,
props.editingTeamID
@@ -353,9 +360,11 @@ const removeExistingTeamMember = async (userID: string) => {
} else {
toast.success(`${t("team.member_removed")}`)
}
+ isLoading.value = false
}
const saveTeam = async () => {
+ isLoading.value = true
if (name.value !== "") {
if (TeamNameCodec.is(name.value)) {
const updateTeamNameResult = await renameTeam(
@@ -380,11 +389,12 @@ const saveTeam = async () => {
hideModal()
toast.success(`${t("team.saved")}`)
} else {
- return toast.error(`${t("team.name_length_insufficient")}`)
+ toast.error(`${t("team.name_length_insufficient")}`)
}
} else {
- return toast.error(`${t("empty.team_name")}`)
+ toast.error(`${t("empty.team_name")}`)
}
+ isLoading.value = false
}
const hideModal = () => {