2024-02-28 21:49:44 +05:00
|
|
|
import * as ActionTypes from '../actionTypes'
|
|
|
|
import {
|
|
|
|
AuthState,
|
|
|
|
Keys,
|
2024-10-05 14:56:34 +02:00
|
|
|
LoginMethod,
|
2024-02-28 21:49:44 +05:00
|
|
|
SetAuthState,
|
|
|
|
UpdateKeyPair,
|
|
|
|
UpdateLoginMethod,
|
2024-10-04 11:37:20 +02:00
|
|
|
NostrLoginAuthMethod,
|
|
|
|
UpdateNostrLoginAuthMethod
|
2024-02-28 21:49:44 +05:00
|
|
|
} from './types'
|
|
|
|
|
|
|
|
export const setAuthState = (payload: AuthState): SetAuthState => ({
|
|
|
|
type: ActionTypes.SET_AUTH_STATE,
|
|
|
|
payload
|
|
|
|
})
|
|
|
|
|
|
|
|
export const updateLoginMethod = (
|
2024-10-05 14:56:34 +02:00
|
|
|
payload: LoginMethod | undefined
|
2024-02-28 21:49:44 +05:00
|
|
|
): UpdateLoginMethod => ({
|
|
|
|
type: ActionTypes.UPDATE_LOGIN_METHOD,
|
|
|
|
payload
|
|
|
|
})
|
|
|
|
|
2024-10-04 11:37:20 +02:00
|
|
|
export const updateNostrLoginAuthMethod = (
|
|
|
|
payload: NostrLoginAuthMethod | undefined
|
|
|
|
): UpdateNostrLoginAuthMethod => ({
|
|
|
|
type: ActionTypes.UPDATE_NOSTR_LOGIN_AUTH_METHOD,
|
|
|
|
payload
|
|
|
|
})
|
|
|
|
|
2024-02-28 21:49:44 +05:00
|
|
|
export const updateKeyPair = (payload: Keys | undefined): UpdateKeyPair => ({
|
|
|
|
type: ActionTypes.UPDATE_KEYPAIR,
|
|
|
|
payload
|
|
|
|
})
|