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.

TriggersExit not firing again after "stop()"ped

See original GitHub issue

the titles sums it up - I’m unable to have my triggersExit function fire again, after it has been stopped.

this is my code

FlowRouter.route('/lobby/:id', {
    name:'lobby',
    action() {
        BlazeLayout.render('default_layout', {content:'lobby'})
    },
    triggersExit:[(context, redirect, stop) => {
        if(context.params.id
        && Lobbies.findOne({_id:context.params.id, state:{$ne:2}}))
            if(!confirm(`The lobby isn't over.\n\n Are you sure you want to leave this page?`))
                stop()
    }]
})

The trigger is fired the first time I try to leave the route, but won’t trigger again before I navigate away from the route or refresh.

I’m not sure if this is a bug, or if I’m approaching this the wrong way 😃

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jan 22, 2016

I hope this can either be accepted as a bug or dismissed as a misunderstanding on my part 😃

I find it quite logical that triggersExit should run a 2nd time, if I stop() it the first time, and don’t navigate away

0reactions
convexsetcommented, Aug 16, 2016

Fixed relatively comprehensively here: https://github.com/kadirahq/flow-router/pull/681

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent user from exiting a route · Issue #318
So we popup a modal with a confirm / cancel option. The problem now is that this requires a callback, so the triggersExit...
Read more >
Sample records for daily average exit
Bacterial colonization patterns in daily chlorhexidine care at the exit site in peritoneal dialysis (PD) patients were not known. We performed a prospective ......
Read more >
https://cgit.freedesktop.org/~dbn/pkg-config/plain...
622149 --disable-regex breaks glib2 build 639873 GBinding: Crash when binding two properties on the same... 640202 For GLIB v.
Read more >
Control of the M/G1 and GI1/S phase - TSpace - University of Toronto
activates pre-replicative origin firing, prevents origin refiring and promotes mitotic events such as chromosome segregation. At the end of mitosis, ...
Read more >
(Public Pack)Agenda Document for Cabinet, 01/02/2017 16:00
If a decision is not called-in, it will be implemented after the expiry of ... that the Government had committed to working with...
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