From b07d0c69cc8096812a03ea310cc326b60d12042b Mon Sep 17 00:00:00 2001 From: nivedin Date: Tue, 12 Dec 2023 19:43:08 +0530 Subject: [PATCH] chore: update opened team coll tab and toast added --- packages/hoppscotch-common/locales/en.json | 1 + .../src/components/collections/index.vue | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index 032309d39..1d70b503b 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -174,6 +174,7 @@ "new": "New Collection", "order_changed": "Collection Order Updated", "properties":"Colection Properties", + "properties_updated": "Collection Properties Updated", "renamed": "Collection renamed", "request_in_use": "Request in use", "save_as": "Save as", diff --git a/packages/hoppscotch-common/src/components/collections/index.vue b/packages/hoppscotch-common/src/components/collections/index.vue index cc84061d4..073554828 100644 --- a/packages/hoppscotch-common/src/components/collections/index.vue +++ b/packages/hoppscotch-common/src/components/collections/index.vue @@ -2130,24 +2130,27 @@ const setCollectionProperties = (newCollection: { (err: GQLError) => { toast.error(`${getErrorMessage(err)}`) }, - async () => { - nextTick(() => { - const { auth, headers } = - teamCollectionAdapter.cascadeParentCollectionForHeaderAuth(path) - - updateInheritedPropertiesForAffectedRequests( - path, - { - auth, - headers, - }, - "rest", - "team" - ) - }) + () => { + toast.success(t("collection.properties_updated")) } ) )() + + //This is a hack to update the inherited properties of the requests if there an tab opened + // since it takes a little bit of time to update the collection tree + setTimeout(() => { + const { auth, headers } = + teamCollectionAdapter.cascadeParentCollectionForHeaderAuth(path) + updateInheritedPropertiesForAffectedRequests( + path, + { + auth, + headers, + }, + "rest", + "team" + ) + }, 200) } displayModalEditProperties(false)