aboutsummaryrefslogtreecommitdiff
path: root/src/services/UserProfileService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/UserProfileService.ts')
-rw-r--r--src/services/UserProfileService.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts
index e733cb47..828cdbf7 100644
--- a/src/services/UserProfileService.ts
+++ b/src/services/UserProfileService.ts
@@ -107,8 +107,11 @@ const integratedSocialPostsEndpoints: {[social: string]: string} = {
export const loadSocialPosts: (
userId: string,
socialType: string,
-) => Promise<SocialAccountType> = async (userId, socialType) => {
- const token = await AsyncStorage.getItem('token');
+ token?: string,
+) => Promise<SocialAccountType> = async (userId, socialType, token) => {
+ if (!token) {
+ token = (await AsyncStorage.getItem('token')) ?? '';
+ }
const endpoint = integratedSocialPostsEndpoints[socialType];
const accountData: SocialAccountType = {};
accountData.posts = [];