question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Description

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'))

    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
         }
      }
   ]
}

Initial view

image

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • [ x] question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • [x ] I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
  • I’ve read and agree to the Code of Conduct.
  • [ x] I’ve searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Packages:

Select all that apply:

  • @slack/web-api
  • @slack/events-api
  • @slack/interactive-messages
  • @slack/rtm-api
  • @slack/webhooks
  • @slack/oauth
  • I don’t know

Reproducible in:

package version:

node version:

OS version(s):

Steps to reproduce:

Expected result:

I want to see initial view getting update to “view2”

Actual result:

Updated pop up only seen for split second on clicking submit button and closes

What actually happened

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
seratchcommented, Jan 14, 2021

@ruberVulpes Thanks for jumping in! @ravi7271973 It seems you’ve already added a reaction to my reply. Could you close this issue if we do not have any further topic to discuss here? (I will be closing this after waiting for your response for a few more days)

1reaction
seratchcommented, Jan 12, 2021

@ravi7271973 Instead of calling views.push API method (the code slack_client.views_push in your app), you can return the following JSON body in response to view_submission requests. In other words, using "response_action": "push" in response.

return jsonify(
    {
        "response_action": "push",
        "view": {
            "type": "modal",
            "title": {"type": "plain_text", "text": "Updated view"},
            "blocks": [
                {
                    "type": "section",
                    "text": {
                        "type": "plain_text",
                        "text": "I've changed and I'll never be the same. You must believe me.",
                    },
                }
            ],
        },
    }
)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap modal: close current, open new - Stack Overflow
When an user pushes a button inside this modal, I want the current modal to hide, and immediately after that, I want a...
Read more >
How to Make a Modal Popup Refresh Items on the Page
In this guide, you'll learn several methods to refresh a page on closing a react-bootstrap modal. Creating a React Bootstrap Modal. To get ......
Read more >
Using modals in Slack apps
The newly pushed view will immediately become visible to the user. When the user closes or submits this new view, they'll return to...
Read more >
Modal - Bootstrap
Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Read more >
SkillBuilders Modal Page... closes immediately after loading
I installed the two sample applications from their web site with ... I can't see anything but the bar with the window name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found