aboutsummaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorIvan Chen <ivan@thetaggid.com>2021-03-05 17:21:20 -0500
committerGitHub <noreply@github.com>2021-03-05 17:21:20 -0500
commit1519e67cb495282ad436796abfa3236ceb31cb10 (patch)
tree87956d553704f3f42d86fe0f8db68e572ac817c5 /src/store
parentb1dee65ee7bb8e120fc38a495f4027905d300650 (diff)
parent10aa8805038f07b1affdcfa1b924810a2c89bee1 (diff)
Merge pull request #242 from ankit-thanekar007/tma-634-badge-selection-screen
Badge Screen UI Changes
Diffstat (limited to 'src/store')
-rw-r--r--src/store/actions/user.ts12
-rw-r--r--src/store/reducers/userBlockReducer.ts5
2 files changed, 15 insertions, 2 deletions
diff --git a/src/store/actions/user.ts b/src/store/actions/user.ts
index a9f9d945..4f1da47c 100644
--- a/src/store/actions/user.ts
+++ b/src/store/actions/user.ts
@@ -174,6 +174,18 @@ export const uploadedSuggestedPeoplePhoto = (
type: setSuggestedPeopleImage.type,
payload: {suggestedPeopleImage: imageUri},
});
+ } catch (error) {
+ console.log(error);
+ }
+};
+
+export const suggestedPeopleBadgesFinished = (): ThunkAction<
+ Promise<void>,
+ RootState,
+ unknown,
+ Action<string>
+> => async (dispatch) => {
+ try {
dispatch({
type: setSuggestedPeopleLinked.type,
payload: {suggested_people_linked: 1},
diff --git a/src/store/reducers/userBlockReducer.ts b/src/store/reducers/userBlockReducer.ts
index 90e4a04a..64bdda30 100644
--- a/src/store/reducers/userBlockReducer.ts
+++ b/src/store/reducers/userBlockReducer.ts
@@ -11,8 +11,9 @@ const userBlockSlice = createSlice({
updateBlockedList: (state, action) => {
const {isBlocked, data} = action.payload;
- if (!isBlocked) state.blockedUsers.push(data);
- else {
+ if (!isBlocked) {
+ state.blockedUsers.push(data);
+ } else {
state.blockedUsers = state.blockedUsers.filter(
(user) => user.username != data.username,
);