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({
|
||||
projectId: projectId,
|
||||
});
|
||||
console.log(
|
||||
credential.user, credential.email, credential.fullName?.givenName,
|
||||
credential.fullName?.familyName, pushToken.data
|
||||
);
|
||||
|
||||
|
||||
const initialDataResponse = await getInitialDataByAppleId(credential.user);
|
||||
|
||||
console.log(initialDataResponse);
|
||||
if (initialDataResponse.status === 404 || !initialDataResponse.ok) {
|
||||
if (!credential.user || !credential.email ||
|
||||
!credential.fullName?.givenName || !credential.fullName?.familyName ||
|
||||
|
@ -39,9 +39,7 @@ const RequestRelationship:
|
||||
}
|
||||
const user = await getUser() as User;
|
||||
setIsLoading(true);
|
||||
console.log(user.id, encodeURIComponent(term));
|
||||
const users: User[] = await searchUsers(user.id, encodeURIComponent(term)) as User[];
|
||||
console.log(users);
|
||||
setSearchResults(users);
|
||||
setIsLoading(false);
|
||||
}, 300), []);
|
||||
|
@ -19,7 +19,6 @@ const UserInfo: React.FC<UserInfoProps> = ({ onPfpUpdate }) => {
|
||||
try {
|
||||
const user: User = await getUser() as User;
|
||||
setUser(user);
|
||||
console.log(`${process.env.EXPO_PUBLIC_API_URL}${user.pfpUrl}`);
|
||||
if (user.pfpUrl)
|
||||
onPfpUpdate(user.pfpUrl);
|
||||
} catch (error) {
|
||||
|
@ -131,13 +131,17 @@ export const saveInitialData = async (initialData: InitialData) => {
|
||||
try {
|
||||
await SecureStore.setItemAsync('user', JSON.stringify(initialData.user));
|
||||
if (initialData.relationshipData) {
|
||||
console.log('Saving relationship data to SecureStore...');
|
||||
console.log('Relationship:', initialData.relationshipData.relationship);
|
||||
await SecureStore.setItemAsync(
|
||||
'relationship', JSON.stringify(initialData.relationshipData.relationship)
|
||||
);
|
||||
console.log('Partner:', initialData.relationshipData.partner);
|
||||
await SecureStore.setItemAsync(
|
||||
'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) {
|
||||
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) => {
|
||||
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}`), {
|
||||
headers: {
|
||||
'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);
|
||||
throw error;
|
||||
}
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user