Slack modal opens and closes after split seconds (Javascript)

21 Views Asked by At

My slack modal opens but closes suddenly in views.update, I want my modal to remain open until I click the submit button to call another view.

My app consist of 3 different views, that has submit button for each.

My await app.client.views.update inside the IF statement updates and opens for a split second and then close. I have 2 more views that works perfectly fine when updating the modal. What is wrong with this condition? show the modal and do not close it unless submit button is clicked again or if close button is clicked.

sample = ['sample'];

if (sample.length) {
  const myPayload = await Promise.all(
    sample.map(async(selectedUser) => {
      return buildMyPayload(name, age, selectedUser, position, manager);
    })
  );
  await app.client.views.update({
    view_id: viewId,
    view: engageModal(channelInfo, engagePayload),
  });
  return '', 200
} else {
  console.log('not found');
  await app.client.views.update({
    view_id: viewId,
    view: UserNotFound(),
  });
}
0

There are 0 best solutions below