aboutsummaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
Diffstat (limited to 'src/store')
-rw-r--r--src/store/actions/user.ts2
-rw-r--r--src/store/actions/userFriends.ts23
2 files changed, 13 insertions, 12 deletions
diff --git a/src/store/actions/user.ts b/src/store/actions/user.ts
index 46f96d9a..374154da 100644
--- a/src/store/actions/user.ts
+++ b/src/store/actions/user.ts
@@ -1,3 +1,4 @@
+import AsyncStorage from '@react-native-community/async-storage';
import {Action, ThunkAction} from '@reduxjs/toolkit';
import {
getProfilePic,
@@ -157,6 +158,7 @@ export const logout = (): ThunkAction<
Action<string>
> => async (dispatch) => {
try {
+ await AsyncStorage.clear();
dispatch({type: userLoggedIn.type, payload: {userId: '', username: ''}});
} catch (error) {
console.log(error);
diff --git a/src/store/actions/userFriends.ts b/src/store/actions/userFriends.ts
index 9da3cb4a..4183d0f6 100644
--- a/src/store/actions/userFriends.ts
+++ b/src/store/actions/userFriends.ts
@@ -1,25 +1,24 @@
-import {getTokenOrLogout, userXInStore} from '../../utils';
-import {RootState} from '../rootReducer';
-import {
- FriendshipStatusType,
- ProfilePreviewType,
- ScreenType,
- UserType,
-} from '../../types/types';
+import {Action, ThunkAction} from '@reduxjs/toolkit';
import {
acceptFriendRequestService,
addFriendService,
+ deleteFriendshipService,
friendOrUnfriendUser,
loadFriends,
- deleteFriendshipService,
} from '../../services';
-import {Action, ThunkAction} from '@reduxjs/toolkit';
import {
- userFriendsFetched,
+ FriendshipStatusType,
+ ProfilePreviewType,
+ ScreenType,
+ UserType,
+} from '../../types/types';
+import {getTokenOrLogout, userXInStore} from '../../utils';
+import {
updateFriends,
+ userFriendsFetched,
userXFriendshipEdited,
- userLoggedIn,
} from '../reducers';
+import {RootState} from '../rootReducer';
export const loadFriendsData = (
userId: string,