aboutsummaryrefslogtreecommitdiff
path: root/src/components/taggs/TaggsBar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/taggs/TaggsBar.tsx')
-rw-r--r--src/components/taggs/TaggsBar.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/taggs/TaggsBar.tsx b/src/components/taggs/TaggsBar.tsx
index 12e4b93a..082743d0 100644
--- a/src/components/taggs/TaggsBar.tsx
+++ b/src/components/taggs/TaggsBar.tsx
@@ -12,7 +12,7 @@ import {StatusBarHeight} from '../../utils';
import Tagg from './Tagg';
import {RootState} from '../../store/rootReducer';
import {ScreenType} from '../../types';
-import {loadIndividualSocial} from '../../store/actions';
+import {loadIndividualSocial, updateSocial} from '../../store/actions';
const {View, ScrollView, interpolate, Extrapolate} = Animated;
interface TaggsBarProps {
@@ -38,10 +38,15 @@ const TaggsBar: React.FC<TaggsBarProps> = ({
/**
* Updates the individual social that needs update
+ * If username is empty, update nonintegrated socials like Snapchat and TikTok
* @param socialType Type of the social that needs update
*/
- const handleSocialUpdate = (socialType: string) => {
- dispatch(loadIndividualSocial(user.userId, socialType));
+ const handleSocialUpdate = (socialType: string, username: string) => {
+ if (username !== '') {
+ dispatch(updateSocial(socialType, username));
+ } else {
+ dispatch(loadIndividualSocial(user.userId, socialType));
+ }
};
/**