aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/ProfileHeader.tsx
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-04-23 15:49:15 -0700
committerShravya Ramesh <shravs1208@gmail.com>2021-04-23 15:49:15 -0700
commit45d0a3aeb97c71cd73a198fc7f1aea67e0996009 (patch)
tree67cb84bb80f93d44254056197b141f792103bf42 /src/components/profile/ProfileHeader.tsx
parente676ec0c9124613507b2064cb139522a2568c26e (diff)
value from and to async for tutorial
Diffstat (limited to 'src/components/profile/ProfileHeader.tsx')
-rw-r--r--src/components/profile/ProfileHeader.tsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/profile/ProfileHeader.tsx b/src/components/profile/ProfileHeader.tsx
index 5d5b695e..665ce0a0 100644
--- a/src/components/profile/ProfileHeader.tsx
+++ b/src/components/profile/ProfileHeader.tsx
@@ -1,4 +1,5 @@
-import React, {useLayoutEffect, useRef, useState} from 'react';
+import AsyncStorage from '@react-native-community/async-storage';
+import React, {useEffect, useLayoutEffect, useRef, useState} from 'react';
import {StyleSheet, Text, View} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
import {useSelector, useStore} from 'react-redux';
@@ -50,6 +51,17 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
const childRef = useRef(null);
const [measure, setMeasure] = useState(null);
const [showBadgeTutorial, setShowBadgeTutorial] = useState(false);
+
+ useEffect(() => {
+ const getBadgeTutorialAsync = async () => {
+ const res = await AsyncStorage.getItem('hasSeenBadgeTutorial');
+ if (res === 'true') {
+ setShowBadgeTutorial(false);
+ }
+ };
+ getBadgeTutorialAsync();
+ });
+
useLayoutEffect(() => {
setTimeout(() => {
measureStuff();