imports/vx/client/code/vxapp.js
/**
     * Logout gracefully.  It is necessary to redirect to home prior to logout in order to
     * ensure that React containers do not re-draw pages that require current Meteor user ID.
     *
     * @param {function} callback Callback function.
     */
Logout gracefully.  It is necessary to redirect to home prior to logout in order to
ensure that React containers do not re-draw pages that require current Meteor user ID.

@param {function} callback Callback function.
Logout gracefully . It is necessary to redirect to home prior to logout in order to ensure that React containers do not re - draw pages that require current Meteor user ID . @param { function } callback Callback function .
logout(callback) {
        OLog.debug(`vxapp.js logout user=${Util.getUserEmail(Meteor.userId())}`)
        VXApp.clearSessionSettings()
        if (callback) {
            Meteor.setTimeout(() => {
                callback()
            })
        }
        OLog.debug("vxapp.js logout function was successful, redirecting to signin page and deferring logout")
        UX.go("/")
        Meteor.setTimeout(() => {
            OLog.debug("vxapp.js logout purging redux persist store and UXState.previousBefore route")
            Persistor.purge().then(() => { return Persistor.flush() }).then(() => { Persistor.pause() })
            UXState.previousBefore = null
            Meteor.logout(error => {
                if (error) {
                    OLog.error(`vxapp.js logout function returned unexpected error=${error}`)
                    return
                }
                OLog.debug("vxapp.js logout was successful")
            })
        }, 1000)
    }
logout ( callback ) { OLog . debug ( ` ${ Util . getUserEmail ( Meteor . userId ( ) ) } ` ) VXApp . clearSessionSettings ( ) if ( callback ) { Meteor . setTimeout ( ( ) => { callback ( ) } ) } OLog . debug ( "vxapp.js logout function was successful, redirecting to signin page and deferring logout" ) UX . go ( "/" ) Meteor . setTimeout ( ( ) => { OLog . debug ( "vxapp.js logout purging redux persist store and UXState.previousBefore route" ) Persistor . purge ( ) . then ( ( ) => { return Persistor . flush ( ) } ) . then ( ( ) => { Persistor . pause ( ) } ) UXState . previousBefore = null Meteor . logout ( error => { if ( error ) { OLog . error ( ` ${ error } ` ) return } OLog . debug ( "vxapp.js logout was successful" ) } ) } , 1000 ) }
Logout gracefully.
Logout gracefully .