mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 04:27:56 +00:00
fix: remove double verification and add debug logging
- Remove verification dialog from Citizens.tsx (GovernmentEntrance handles it) - Add console debug logging to see roleNFTs and authorization check
This commit is contained in:
@@ -228,9 +228,8 @@ export default function Citizens() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Show citizen number verification dialog for Government
|
||||
setDialogType('gov');
|
||||
setShowGovDialog(true);
|
||||
// Navigate directly - GovernmentEntrance will handle verification
|
||||
navigate('/citizens/government');
|
||||
};
|
||||
|
||||
const handleVerifyCitizenNumber = () => {
|
||||
|
||||
@@ -190,14 +190,25 @@ export default function GovernmentEntrance() {
|
||||
|
||||
// KONTROL 2: Hükümet yetkili Tiki kontrolü
|
||||
const userTikis = nftDetails.roleNFTs || []; // DashboardContext'te roleNFTs olarak geliyor
|
||||
|
||||
// Debug logging
|
||||
console.log('=== Government Access Debug ===');
|
||||
console.log('roleNFTs:', userTikis);
|
||||
console.log('roleNFTs count:', userTikis.length);
|
||||
userTikis.forEach((tiki, i) => {
|
||||
console.log(`roleNFT[${i}]:`, tiki.tikiRole, tiki);
|
||||
});
|
||||
console.log('GOVERNMENT_AUTHORIZED_TIKIS:', GOVERNMENT_AUTHORIZED_TIKIS);
|
||||
|
||||
const hasAuthorizedTiki = userTikis.some(tiki =>
|
||||
GOVERNMENT_AUTHORIZED_TIKIS.includes(tiki.tikiRole)
|
||||
);
|
||||
console.log('hasAuthorizedTiki:', hasAuthorizedTiki);
|
||||
|
||||
if (!hasAuthorizedTiki) {
|
||||
toast({
|
||||
title: "Mafê Te Tuneye (No Authorization)",
|
||||
description: "Hûn xwedîyê Tiki-yeke hikûmetê nînin. Tenê xwedîyên Tiki-yên hikûmetê dikarin vê rûpelê bigihînin (You do not own a government Tiki. Only government Tiki holders can access this page)",
|
||||
description: `Hûn xwedîyê Tiki-yeke hikûmetê nînin. Tikiyên we: ${userTikis.map(t => t.tikiRole).join(', ') || 'tune'}`,
|
||||
variant: "destructive"
|
||||
});
|
||||
setIsVerifying(false);
|
||||
|
||||
Reference in New Issue
Block a user