mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 19:27:56 +00:00
feat: complete URL-based referral system integration
Frontend changes: - Add ReferralHandler to App.tsx to capture ?ref= URL parameter - Store referrer address in localStorage for KYC registration - Improve DashboardContext error handling for Supabase All referral functionality now complete: - URL parameter capture and storage - On-chain referral initiation via InviteUserModal - Auto-confirmation via OnKycApproved hook - DefaultReferrer fallback to QaziMuhammedAccount - Real-time stats and event subscription - Referral score calculation (0-500 points) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,10 @@ export function DashboardProvider({ children }: { children: ReactNode }) {
|
||||
}, [user, selectedAccount, api, isApiReady]);
|
||||
|
||||
const fetchProfile = async () => {
|
||||
if (!user) return;
|
||||
if (!user) {
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const { data, error } = await supabase
|
||||
@@ -45,13 +48,13 @@ export function DashboardProvider({ children }: { children: ReactNode }) {
|
||||
.maybeSingle();
|
||||
|
||||
if (error) {
|
||||
console.error('Profile fetch error:', error);
|
||||
console.warn('Profile fetch error (this is normal if Supabase is not configured):', error.message);
|
||||
return;
|
||||
}
|
||||
|
||||
setProfile(data);
|
||||
} catch (error) {
|
||||
console.error('Error fetching profile:', error);
|
||||
console.warn('Error fetching profile (this is normal if Supabase is not configured):', error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user