How to trigger modal from Meteor.startup()?

Hi guys,

Need help. How to trigger modal (semantic ui) from Meteor.startup() global? Please help, thanks…

import '../../component/exitModal/exitModal';
import {
} from 'meteor/ostrio:flow-router-extra';

Meteor.startup(function () {
    // Here we can be sure the plugin has been initialized
    document.addEventListener("backbutton", onBackButtonDown, false);

    function onBackButtonDown() {
        console.log('Back Button Pressed!');
        let currentRoute = FlowRouter.getRouteName();
        console.log('Current Route Name: ' + currentRoute);
        if (currentRoute == 'usermainscreen' || currentRoute == 'index') {
            console.log('Route name Match! Show modal now...');
        } else {

I don’t think Meteor.startup() is appropriate place to do it. You better put it a componentDidMount() of a React component.

1 Like

Ok thanks. I’ll just try move it some where else. Thanks again.