-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrated back to redux store for necessary variables
- Loading branch information
1 parent
6e96423
commit 4cfc951
Showing
13 changed files
with
128 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { PayloadAction, createSlice } from '@reduxjs/toolkit' | ||
|
||
export type AuthState = { | ||
loading: boolean | ||
loggedIn: boolean | ||
loggingOut: boolean | ||
syncing: boolean | ||
displayBiometricsPreferenceScreen: boolean | ||
} | ||
|
||
export const initialAuthState: AuthState = { | ||
loading: false, | ||
loggedIn: false, | ||
loggingOut: false, | ||
syncing: false, | ||
displayBiometricsPreferenceScreen: true, | ||
} | ||
|
||
/** | ||
* Redux slice that will create the actions and reducers | ||
*/ | ||
const authSlice = createSlice({ | ||
name: 'auth', | ||
initialState: initialAuthState, | ||
reducers: { | ||
dispatchUpdateLoading: (state, action: PayloadAction<boolean>) => { | ||
state.loading = action.payload | ||
}, | ||
dispatchUpdateLoggedIn: (state, action: PayloadAction<boolean>) => { | ||
state.loggedIn = action.payload | ||
}, | ||
dispatchUpdateLoggingOut: (state, action: PayloadAction<boolean>) => { | ||
state.loggingOut = action.payload | ||
}, | ||
dispatchUpdateSyncing: (state, action: PayloadAction<boolean>) => { | ||
state.syncing = action.payload | ||
}, | ||
dispatchUpdateDisplayBiometricsPreferenceScreen: (state, action: PayloadAction<boolean>) => { | ||
state.displayBiometricsPreferenceScreen = action.payload | ||
}, | ||
}, | ||
}) | ||
|
||
export const { | ||
dispatchUpdateLoading, | ||
dispatchUpdateLoggedIn, | ||
dispatchUpdateLoggingOut, | ||
dispatchUpdateSyncing, | ||
dispatchUpdateDisplayBiometricsPreferenceScreen, | ||
} = authSlice.actions | ||
export default authSlice.reducer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.