Fixed some new errors. Cleaned up console logs
This commit is contained in:
parent
77481b4ac4
commit
8b9cbdfc0f
@ -30,14 +30,9 @@ const SignInScreen = ({onSignIn}: {onSignIn: () => void}) => {
|
|||||||
const pushToken = await Notifications.getExpoPushTokenAsync({
|
const pushToken = await Notifications.getExpoPushTokenAsync({
|
||||||
projectId: projectId,
|
projectId: projectId,
|
||||||
});
|
});
|
||||||
console.log(
|
|
||||||
credential.user, credential.email, credential.fullName?.givenName,
|
|
||||||
credential.fullName?.familyName, pushToken.data
|
|
||||||
);
|
|
||||||
|
|
||||||
const initialDataResponse = await getInitialDataByAppleId(credential.user);
|
const initialDataResponse = await getInitialDataByAppleId(credential.user);
|
||||||
|
|
||||||
console.log(initialDataResponse);
|
|
||||||
if (initialDataResponse.status === 404 || !initialDataResponse.ok) {
|
if (initialDataResponse.status === 404 || !initialDataResponse.ok) {
|
||||||
if (!credential.user || !credential.email ||
|
if (!credential.user || !credential.email ||
|
||||||
!credential.fullName?.givenName || !credential.fullName?.familyName ||
|
!credential.fullName?.givenName || !credential.fullName?.familyName ||
|
||||||
|
@ -39,9 +39,7 @@ const RequestRelationship:
|
|||||||
}
|
}
|
||||||
const user = await getUser() as User;
|
const user = await getUser() as User;
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
console.log(user.id, encodeURIComponent(term));
|
|
||||||
const users: User[] = await searchUsers(user.id, encodeURIComponent(term)) as User[];
|
const users: User[] = await searchUsers(user.id, encodeURIComponent(term)) as User[];
|
||||||
console.log(users);
|
|
||||||
setSearchResults(users);
|
setSearchResults(users);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}, 300), []);
|
}, 300), []);
|
||||||
|
@ -19,7 +19,6 @@ const UserInfo: React.FC<UserInfoProps> = ({ onPfpUpdate }) => {
|
|||||||
try {
|
try {
|
||||||
const user: User = await getUser() as User;
|
const user: User = await getUser() as User;
|
||||||
setUser(user);
|
setUser(user);
|
||||||
console.log(`${process.env.EXPO_PUBLIC_API_URL}${user.pfpUrl}`);
|
|
||||||
if (user.pfpUrl)
|
if (user.pfpUrl)
|
||||||
onPfpUpdate(user.pfpUrl);
|
onPfpUpdate(user.pfpUrl);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -131,13 +131,17 @@ export const saveInitialData = async (initialData: InitialData) => {
|
|||||||
try {
|
try {
|
||||||
await SecureStore.setItemAsync('user', JSON.stringify(initialData.user));
|
await SecureStore.setItemAsync('user', JSON.stringify(initialData.user));
|
||||||
if (initialData.relationshipData) {
|
if (initialData.relationshipData) {
|
||||||
|
console.log('Saving relationship data to SecureStore...');
|
||||||
|
console.log('Relationship:', initialData.relationshipData.relationship);
|
||||||
await SecureStore.setItemAsync(
|
await SecureStore.setItemAsync(
|
||||||
'relationship', JSON.stringify(initialData.relationshipData.relationship)
|
'relationship', JSON.stringify(initialData.relationshipData.relationship)
|
||||||
);
|
);
|
||||||
|
console.log('Partner:', initialData.relationshipData.partner);
|
||||||
await SecureStore.setItemAsync(
|
await SecureStore.setItemAsync(
|
||||||
'partner', JSON.stringify(initialData.relationshipData.partner)
|
'partner', JSON.stringify(initialData.relationshipData.partner)
|
||||||
);
|
);
|
||||||
await SecureStore.setItemAsync('countdown', JSON.stringify(initialData.countdown));
|
if (initialData.countdown)
|
||||||
|
await SecureStore.setItemAsync('countdown', JSON.stringify(initialData.countdown));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error saving initial data to SecureStore:', error);
|
console.error('Error saving initial data to SecureStore:', error);
|
||||||
|
@ -100,7 +100,7 @@ export const updateProfilePicture = async (userId: number, pfpUrl: string) => {
|
|||||||
|
|
||||||
export const checkRelationshipStatus = async (userId: number) => {
|
export const checkRelationshipStatus = async (userId: number) => {
|
||||||
try {
|
try {
|
||||||
const apiUrl = `${process.env.EXPO_PUBLIC_API_URL}/api/users/checkRelationship`;
|
const apiUrl = `${process.env.EXPO_PUBLIC_API_URL}/api/relationships/checkStatus`;
|
||||||
const response = await fetch((apiUrl + `?userId=${userId}`), {
|
const response = await fetch((apiUrl + `?userId=${userId}`), {
|
||||||
headers: {
|
headers: {
|
||||||
'x-api-key': process.env.EXPO_PUBLIC_API_KEY ?? '',
|
'x-api-key': process.env.EXPO_PUBLIC_API_KEY ?? '',
|
||||||
@ -190,5 +190,4 @@ export const sendRelationshipRequest = async (userId: number, targetUserId: numb
|
|||||||
console.error('Error sending Relationship request:', error);
|
console.error('Error sending Relationship request:', error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user