Skip to content

Commit

Permalink
add time.sleep to wait to see updated modal
Browse files Browse the repository at this point in the history
  • Loading branch information
KouWakai committed Aug 15, 2023
1 parent 7b783e6 commit 6fe1bec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/modal/modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ func handleModal(w http.ResponseWriter, r *http.Request) {
// You must set one of external_id or view_id and you can use hash for avoiding race condition.
// More details: https://api.slack.com/surfaces/modals/using#updating_apis
_, err := api.UpdateView(updateModal, "", i.View.Hash, i.View.ID)
// Wait for a few seconds to see result this code is necesarry due to slack server modal is going to be closed after the update
time.Sleep(time.Second * 2)

Check failure on line 178 in examples/modal/modal.go

View workflow job for this annotation

GitHub Actions / test go-1.18

undefined: time

Check failure on line 178 in examples/modal/modal.go

View workflow job for this annotation

GitHub Actions / test go-1.19

undefined: time

Check failure on line 178 in examples/modal/modal.go

View workflow job for this annotation

GitHub Actions / test go-1.20

undefined: time
if err != nil {
fmt.Printf("Error updating view: %s", err)
w.WriteHeader(http.StatusInternalServerError)
Expand Down

0 comments on commit 6fe1bec

Please sign in to comment.