aboutsummaryrefslogtreecommitdiff
path: root/src/utils/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/users.ts')
-rw-r--r--src/utils/users.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils/users.ts b/src/utils/users.ts
index d1f416e0..e11e8c78 100644
--- a/src/utils/users.ts
+++ b/src/utils/users.ts
@@ -103,12 +103,15 @@ export const userXInStore = (
* Abstracted the code to laod all socials out.
* @param userId userId for whom socials should be fetched
*/
-export const loadAllSocialsForUser = async (userId: string) => {
+export const loadAllSocialsForUser = async (userId: string, token?: string) => {
+ if (!token) {
+ token = (await AsyncStorage.getItem('token')) ?? '';
+ }
let socials = NO_SOCIAL_ACCOUNTS;
try {
let socialNeedsUpdate = INTEGRATED_SOCIAL_LIST;
for (let socialType of socialNeedsUpdate) {
- const social = await loadSocialPosts(userId, socialType);
+ const social = await loadSocialPosts(userId, socialType, token);
socials = {...socials, [socialType]: social};
}
return socials;
@@ -165,4 +168,3 @@ export const defaultUserProfile = () => {
const defaultImage = require('../assets/images/avatar-placeholder.png');
return defaultImage;
};
-