added encUnlockPin entry in application store

This commit is contained in:
Nouman Tahir 2022-07-27 13:36:03 +05:00
parent 99eb404040
commit 598038d8f6
3 changed files with 18 additions and 2 deletions

View File

@ -31,7 +31,8 @@ import {
SET_COLOR_THEME,
SET_SETTINGS_MIGRATED,
HIDE_POSTS_THUMBNAILS,
SET_TERMS_ACCEPTED
SET_TERMS_ACCEPTED,
SET_ENC_UNLOCK_PIN
} from '../constants/constants';
export const login = (payload) => ({
@ -209,4 +210,9 @@ export const setIsTermsAccepted = (isTermsAccepted:boolean) => ({
type: SET_TERMS_ACCEPTED
})
export const setEncryptedUnlockPin = (encryptedUnlockPin:string) => ({
payload:encryptedUnlockPin,
type: SET_ENC_UNLOCK_PIN
})

View File

@ -36,6 +36,7 @@ export const SET_LAST_APP_VERSION = 'SET_LAST_APP_VERSION';
export const SET_COLOR_THEME = 'SET_COLOR_THEME';
export const SET_SETTINGS_MIGRATED = 'SET_SETTINGS_MIGRATED';
export const SET_TERMS_ACCEPTED = 'SET_TERMS_ACCEPTED';
export const SET_ENC_UNLOCK_PIN = 'SET_ENC_UNLOCK_PIN';
// Accounts
export const ADD_OTHER_ACCOUNT = 'ADD_OTHER_ACCOUNT';

View File

@ -30,6 +30,7 @@ import {
SET_SETTINGS_MIGRATED,
HIDE_POSTS_THUMBNAILS,
SET_TERMS_ACCEPTED,
SET_ENC_UNLOCK_PIN
} from '../constants/constants';
interface State {
@ -65,6 +66,7 @@ interface State {
pin: string|null;
isPinCodeOpen: boolean;
isRenderRequired: boolean;
encUnlockPin: string;
lastAppVersion:string;
settingsMigratedV2: boolean;
hidePostsThumbnails: boolean;
@ -104,13 +106,14 @@ const initialState:State = {
pin: null,
isPinCodeOpen: false,
isRenderRequired: false,
encUnlockPin: '',
lastAppVersion:'',
settingsMigratedV2: false,
hidePostsThumbnails: false,
isTermsAccepted: false,
};
export default function (state = initialState, action) {
export default function (state = initialState, action):State {
switch (action.type) {
case LOGIN:
return {
@ -283,6 +286,12 @@ export default function (state = initialState, action) {
isTermsAccepted:action.payload
}
case SET_ENC_UNLOCK_PIN:
return {
...state,
encUnlockPin:action.payload
}
default:
return state;
}