Skip to content

Commit

Permalink
add documentation how to listen to view_closed events #1010
Browse files Browse the repository at this point in the history
* further cleanup
  • Loading branch information
TheManWhoStaresAtCode committed Nov 19, 2021
1 parent c5f02a0 commit f86fdda
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/_basic/listening_modals.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ To listen to either a `view_submission` request or `view_closed` event, you can

##### Update views on submission

You can access the value of the input blocks by accessing the `state` object. `state` contains a values object that uses the `block_id` and unique `action_id` to store the input values.
To update a view in response to a `view_submission` request, you may pass a `response_action` of type `update` with a newly composed `view` to display in your acknowledgement.

```javascript
Expand All @@ -33,7 +32,8 @@ app.view('modal-callback-id', async ({ ack, body }) => {
```
Similarly, there are options for [displaying errors](https://api.slack.com/surfaces/modals/using#displaying_errors) in response to view submissions.

Read more about view submissions in our <a href="https://api.slack.com/surfaces/modals/using#interactions">API documentation</a>.
You can access the value of the input blocks by accessing the `state` object. `state` contains a values object that uses the `block_id` and unique `action_id` to store the input values.
Read more about view submissions in our [API documentation](https://api.slack.com/surfaces/modals/using#interactions).
</div>

```javascript
Expand Down Expand Up @@ -80,7 +80,7 @@ app.view('view_b', async ({ ack, body, view, client }) => {

💡 When listening for `view_closed` requests, you must pass an object containing `type: 'view_closed'` and the view `callback_id`. See below for an example of this:

See the <a href="https://api.slack.com/surfaces/modals/using#modal_cancellations">API documentation</a> for more information about `view_closed.
See the [API documentation](https://api.slack.com/surfaces/modals/using#modal_cancellations) for more information about `view_closed.

```javascript
// Handle a view_closed event
Expand Down

0 comments on commit f86fdda

Please sign in to comment.