Skip to content

Commit

Permalink
fix: comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Jan 18, 2024
1 parent ab558be commit b5a1478
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/screens/HyperSwitch/UserManagement/InviteUsers.res
Original file line number Diff line number Diff line change
Expand Up @@ -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", "")
Expand All @@ -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),
Expand All @@ -148,10 +148,6 @@ let make = () => {
~toastType=ToastSuccess,
(),
)

if magicLink {
await HyperSwitchUtils.delay(400)
}
RescriptReactRouter.push("/users")
Js.Nullable.null
}
Expand Down

0 comments on commit b5a1478

Please sign in to comment.