src/utils/skynet-ops.js
// Handle a user's login action.
Handle a user's login action.
Handle a user ' s login action .
async function handleMySkyLogin(mySkyInstance, dispatch) {
    try {
        const status = await mySkyInstance.requestLoginAccess();
        dispatch({type: SET_IS_LOGGED_IN, payload: status});
        if (status) {
            await mySkyInstance.userID().then((res) => {
                dispatch({type: ActionTypes.SET_MYSKY_USER_PUBLIC_KEY, payload: res});
            });
        }
    } catch (e) {
        console.error(`Error logging into MySky: ${e.message}`);
    }
}
async function handleMySkyLogin ( mySkyInstance , dispatch ) { try { const status = await mySkyInstance . requestLoginAccess ( ) ; dispatch ( { type : SET_IS_LOGGED_IN , payload : status } ) ; if ( status ) { await mySkyInstance . userID ( ) . then ( ( res ) => { dispatch ( { type : ActionTypes . SET_MYSKY_USER_PUBLIC_KEY , payload : res } ) ; } ) ; } } catch ( e ) { console . error ( ` ${ e . message } ` ) ; } }
Handle a user's login action.
Handle a user ' s login action .
// Try login again, opening popup. Returns true if successful.