import { phoneAuthTrigger , phoneAuthVerify } from './functions' ; import { FIREBASE_PHONE_TRIGGER , FIREBASE_PHONE_VERIFY , IOTPAuth , IPhoneNumberAuth , RESET_CONFIRMATION_CODE , } from './types' ; export const triggerLoginWithPhone = ( payload ) => ( dispatch ) => { dispatch ( { type : FIREBASE_PHONE_TRIGGER , payload , firebase : phoneAuthTrigger , } ) ; } ; export const resetResendCode = ( ) => ( dispatch ) => { dispatch ( { type : RESET_CONFIRMATION_CODE , payload : { } , } ) ; } ; export const verifyOTPPhone = ( payload ) => ( dispatch , getState ) => { dispatch ( { type : FIREBASE_PHONE_VERIFY , payload , firebase : ( _payload ) => phoneAuthVerify ( _payload , getState ( ) . auth . confirmationResult ) , } ) ; } ;