Skip to content

Commit 332b698

Browse files
committed
chore: update dependencies and clean up code
- Updated package versions in package.json and package-lock.json, including next, react, and react-dom. - Added new dependencies: @types/js-cookie and @types/lodash.debounce. - Removed unused console logs and error handling in various components for cleaner code. - Enhanced user profile sharing functionality in ProfileHeader component.
1 parent 9becae5 commit 332b698

13 files changed

Lines changed: 1355 additions & 1313 deletions

File tree

app/(landing)/accept-invitation/[invitationId]/page.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,13 @@ export default function AcceptInvitationPage() {
5353
} else {
5454
throw new Error('Failed to accept invitation');
5555
}
56-
} catch (error) {
57-
console.error('Error accepting invitation:', error);
58-
const message =
59-
error instanceof Error
60-
? error.message
61-
: 'Failed to accept invitation. It may be expired or invalid.';
62-
setErrorMessage(message);
63-
toast.error(message);
56+
} catch {
57+
setErrorMessage(
58+
'Failed to accept invitation. It may be expired or invalid.'
59+
);
60+
toast.error(
61+
'Failed to accept invitation. It may be expired or invalid.'
62+
);
6463
setStatus('error');
6564
}
6665
};

components/buttons/BoundlessButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const boundlessButtonVariants = cva(
5959
);
6060

6161
export interface BoundlessButtonProps
62-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
62+
extends
63+
React.ButtonHTMLAttributes<HTMLButtonElement>,
6364
VariantProps<typeof boundlessButtonVariants> {
6465
asChild?: boolean;
6566
loading?: boolean;

components/campaigns/LaunchCampaignFlow.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ const LaunchCampaignFlow: React.FC<LaunchCampaignFlowProps> = ({
201201
const isFormValid = (): boolean => {
202202
return Boolean(
203203
formData.title &&
204-
formData.description &&
205-
formData.fundingGoal &&
206-
formData.images.length > 0 &&
207-
formData.duration
204+
formData.description &&
205+
formData.fundingGoal &&
206+
formData.images.length > 0 &&
207+
formData.duration
208208
);
209209
};
210210

components/organization/tabs/MembersTab.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export default function MembersTab({ onSave }: MembersTabProps) {
5656
const checkUserIsOwner = async () => {
5757
const checkIsOwner = await isOwner(activeOrgId || undefined);
5858
setUserIsOwner(checkIsOwner);
59-
console.log('userIsOwner', checkIsOwner);
6059
};
6160
checkUserIsOwner();
6261
}, [activeOrgId]);
@@ -91,8 +90,7 @@ export default function MembersTab({ onSave }: MembersTabProps) {
9190
try {
9291
const data = await listBetterAuthInvitations(activeOrg.betterAuthOrgId);
9392
setInvitations(data || []);
94-
} catch (error) {
95-
console.error('Error fetching invitations:', error);
93+
} catch {
9694
toast.error('Failed to load invitations');
9795
} finally {
9896
setLoadingInvitations(false);
@@ -115,9 +113,7 @@ export default function MembersTab({ onSave }: MembersTabProps) {
115113
activeOrg.betterAuthOrgId
116114
);
117115
setInvitations(data || []);
118-
} catch (error) {
119-
console.error('Error refreshing invitations:', error);
120-
}
116+
} catch {}
121117
}
122118
}
123119
};
@@ -178,7 +174,6 @@ export default function MembersTab({ onSave }: MembersTabProps) {
178174
} catch (error) {
179175
const msg = error instanceof Error ? error.message : String(error);
180176
toast.error(`Failed to remove member: ${msg}`);
181-
console.error('Error removing member:', error);
182177
}
183178
};
184179

@@ -205,7 +200,6 @@ export default function MembersTab({ onSave }: MembersTabProps) {
205200
} catch (error) {
206201
const msg = error instanceof Error ? error.message : String(error);
207202
toast.error(`Failed to cancel invitation: ${msg}`);
208-
console.error('Error canceling invitation:', error);
209203
} finally {
210204
setCancelingInvitation(null);
211205
}

components/profile/ProfileHeader.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ export default function ProfileHeader({
6666
title: `Share ${profile.username}'s profile`,
6767
url: profileUrl,
6868
});
69-
} catch (err) {
70-
console.error('Failed to share profile:', err);
71-
}
69+
} catch {}
7270
} else {
7371
try {
7472
await navigator.clipboard.writeText(profileUrl);

hooks/use-auth.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ export function useAuth(requireAuth = true) {
4646
) {
4747
try {
4848
setProfileLoading(true);
49-
console.log('Fetching user profile for useAuth');
5049
const profile = await getMe();
5150
setUserProfile(profile);
52-
} catch (error) {
53-
console.error('Failed to fetch user profile:', error);
51+
} catch {
5452
} finally {
5553
setProfileLoading(false);
5654
}
@@ -63,31 +61,24 @@ export function useAuth(requireAuth = true) {
6361
// Handle required auth redirect
6462
useEffect(() => {
6563
if (requireAuth && !isAuthenticated && !isLoading) {
66-
console.log(
67-
'Auth required but user not authenticated, redirecting to signin'
68-
);
6964
router.push('/auth?mode=signin');
7065
}
7166
}, [requireAuth, isAuthenticated, isLoading, router]);
7267

7368
const refreshUser = useCallback(async () => {
7469
try {
75-
console.log('Refreshing user data');
7670
const profile = await getMe();
7771
setUserProfile(profile);
7872
} catch (error) {
79-
console.error('Failed to refresh user data:', error);
8073
throw error;
8174
}
8275
}, []);
8376

8477
const clearAuth = useCallback(async () => {
8578
try {
86-
console.log('Clearing auth state');
8779
setUserProfile(null);
8880
await authClient.signOut();
8981
} catch (error) {
90-
console.error('Failed to sign out:', error);
9182
throw error;
9283
}
9384
}, []);
@@ -146,8 +137,7 @@ export function useAuthStatus() {
146137
setProfileLoading(true);
147138
const profile = await getMe();
148139
setUserProfile(profile);
149-
} catch (error) {
150-
console.error('Failed to fetch user profile:', error);
140+
} catch {
151141
} finally {
152142
setProfileLoading(false);
153143
}
@@ -169,11 +159,9 @@ export function useAuthActions() {
169159
const router = useRouter();
170160
const logout = useCallback(async () => {
171161
try {
172-
console.log('Signing out user');
173162
await authClient.signOut();
174163
router.push('/');
175164
} catch (error) {
176-
console.error('Failed to sign out:', error);
177165
throw error;
178166
}
179167
}, []);

lib/api/auth.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,17 @@ export const getUserProfileByUsername = async (
4444
*/
4545
export const refreshUserData = async (): Promise<void> => {
4646
try {
47-
console.log('Refreshing user data via API');
4847
await getMe();
4948
} catch (error) {
50-
console.error('Failed to refresh user data:', error);
5149
throw error;
5250
}
5351
};
5452

5553
export const checkAuthStatus = async (): Promise<boolean> => {
5654
try {
57-
console.log('Checking auth status');
5855
const session = await authClient.getSession();
5956
return !!(session && 'user' in session && session.user);
60-
} catch (error) {
61-
console.error('Failed to check auth status:', error);
57+
} catch {
6258
return false;
6359
}
6460
};

0 commit comments

Comments
 (0)