From b5a14783e574a0f957c9bdf7e10d8a8c6c001647 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 18 Jan 2024 17:28:56 +0530 Subject: [PATCH] fix: comments addressed --- src/screens/HyperSwitch/UserManagement/InviteUsers.res | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/screens/HyperSwitch/UserManagement/InviteUsers.res b/src/screens/HyperSwitch/UserManagement/InviteUsers.res index d25e25f4b..5405a75e7 100644 --- a/src/screens/HyperSwitch/UserManagement/InviteUsers.res +++ b/src/screens/HyperSwitch/UserManagement/InviteUsers.res @@ -114,7 +114,7 @@ let make = () => { let response = await PromiseUtils.allSettledPolyfill(promisesOfInvitedUsers) if !magicLink { - let emailPasswordsArray = response->Array.mapWithIndex((ele, index) => { + let invitedUserData = response->Array.mapWithIndex((ele, index) => { switch Js.Json.classify(ele) { | Js.Json.JSONObject(jsonDict) => { let passwordFromResponse = jsonDict->getString("password", "") @@ -129,10 +129,10 @@ let make = () => { setLoaderForInviteUsers(_ => false) - if emailPasswordsArray->Array.length > 0 { + if invitedUserData->Array.length > 0 { DownloadUtils.download( ~fileName=`invited-users.txt`, - ~content=emailPasswordsArray + ~content=invitedUserData ->Array.filter(ele => ele !== Js.Json.null) ->Js.Json.array ->Js.Json.stringifyWithSpace(3), @@ -148,10 +148,6 @@ let make = () => { ~toastType=ToastSuccess, (), ) - - if magicLink { - await HyperSwitchUtils.delay(400) - } RescriptReactRouter.push("/users") Js.Nullable.null }