Thursday, 14 January 2021

Updated pop up modal view seen for a second and closed immediately

Not sure what’s is missing , pasting the exact code.

When I use below method I'm able to see pop getting update on click of submit button but its closing within approximately 2 seconds

def send_views(user_name):

    form_json = json.loads(request.form.get('payload'))
    callback_id = form_json[ 'view' ][ 'callback_id' ]
    print("entered updated view method ")
    
    print("entered updated if")
    open_dialog1 = slack_client.api_call("views.update",
                                          trigger_id=form_json[ "trigger_id" ],
                                          view_id = form_json["view"]["id"],
                                          hash=form_json["view"]["hash"],
                                          view=views2
                                          )


Below is views2 json

views2 = {
   "title": {
      "type": "plain_text",
      "text": "My App",
      "emoji": True
   },
   "type": "modal",
   "close": {
      "type": "plain_text",
      "text": "Cancel",
      "emoji": True
   },
   "blocks": [
      {
         "type": "section",
         "text": {
            "type": "plain_text",
            "text": "Submitted Successfully",
            "emoji": True
         }
      }
   ]
}

Output

enter image description here

enter image description here



from Updated pop up modal view seen for a second and closed immediately

No comments:

Post a Comment