mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-13 09:01:00 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show citizen number verification dialog for Government
|
// Navigate directly - GovernmentEntrance will handle verification
|
||||||
setDialogType('gov');
|
navigate('/citizens/government');
|
||||||
setShowGovDialog(true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleVerifyCitizenNumber = () => {
|
const handleVerifyCitizenNumber = () => {
|
||||||
|
|||||||
@@ -190,14 +190,25 @@ export default function GovernmentEntrance() {
|
|||||||
|
|
||||||
// KONTROL 2: Hükümet yetkili Tiki kontrolü
|
// KONTROL 2: Hükümet yetkili Tiki kontrolü
|
||||||
const userTikis = nftDetails.roleNFTs || []; // DashboardContext'te roleNFTs olarak geliyor
|
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 =>
|
const hasAuthorizedTiki = userTikis.some(tiki =>
|
||||||
GOVERNMENT_AUTHORIZED_TIKIS.includes(tiki.tikiRole)
|
GOVERNMENT_AUTHORIZED_TIKIS.includes(tiki.tikiRole)
|
||||||
);
|
);
|
||||||
|
console.log('hasAuthorizedTiki:', hasAuthorizedTiki);
|
||||||
|
|
||||||
if (!hasAuthorizedTiki) {
|
if (!hasAuthorizedTiki) {
|
||||||
toast({
|
toast({
|
||||||
title: "Mafê Te Tuneye (No Authorization)",
|
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"
|
variant: "destructive"
|
||||||
});
|
});
|
||||||
setIsVerifying(false);
|
setIsVerifying(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user