|
216 | 216 | w3id: data.w3id
|
217 | 217 | });
|
218 | 218 |
|
| 219 | + // Skip visualization if no matching eVault found |
| 220 | + if (evaultIndex === -1) { |
| 221 | + console.log('Skipping visualization - no matching eVault found'); |
| 222 | + return; |
| 223 | + } |
| 224 | +
|
219 | 225 | // Step 1: Platform creates entry locally
|
220 | 226 | currentFlowStep = 1;
|
221 | 227 | flowMessages = [
|
|
496 | 502 | console.log('getEvaultIndex called with w3id:', w3id);
|
497 | 503 | console.log('selectedEVaults:', selectedEVaults);
|
498 | 504 |
|
499 |
| - // Since evaultId is the same as w3id, prioritize that match |
| 505 | + // Strip the @ symbol from w3id if present |
| 506 | + const cleanW3id = w3id.replace('@', ''); |
| 507 | + console.log('Cleaned w3id:', cleanW3id); |
| 508 | +
|
| 509 | + // Since evaultId is the same as w3id (without @), prioritize that match |
500 | 510 | const index = selectedEVaults.findIndex((e) => {
|
501 |
| - const matches = e.evaultId === w3id; |
| 511 | + const matches = e.evaultId === cleanW3id; |
502 | 512 |
|
503 | 513 | if (matches) {
|
504 | 514 | console.log('Found matching eVault by evaultId:', e);
|
|
515 | 525 |
|
516 | 526 | // If no match found, log all available evaultIds for debugging
|
517 | 527 | if (index === -1) {
|
518 |
| - console.log('No match found for w3id:', w3id); |
| 528 | + console.log('No match found for cleaned w3id:', cleanW3id); |
519 | 529 | console.log('Available evaultIds:');
|
520 | 530 | selectedEVaults.forEach((evault, i) => {
|
521 | 531 | console.log(`eVault ${i}: evaultId = "${evault.evaultId}"`);
|
522 | 532 | });
|
523 | 533 |
|
524 |
| - // Fall back to index 0 if no match found |
525 |
| - console.log('Falling back to index 0'); |
526 |
| - return 0; |
| 534 | + // Return -1 to indicate no match found |
| 535 | + console.log('No matching eVault found, skipping visualization'); |
| 536 | + return -1; |
527 | 537 | }
|
528 | 538 |
|
529 | 539 | return index;
|
|
0 commit comments