|
53 | 53 | return;
|
54 | 54 | }
|
55 | 55 |
|
56 |
| - // Check if any items are selected, if not show selection interface |
57 |
| - if ( |
58 |
| - (!selectedEVaults || selectedEVaults.length === 0) && |
59 |
| - (!selectedPlatforms || selectedPlatforms.length === 0) |
60 |
| - ) { |
61 |
| - return; |
62 |
| - } |
63 |
| -
|
64 | 56 | // Create nodes from selected items
|
65 | 57 | const newNodes: Node[] = [];
|
66 | 58 | let nodeId = 1;
|
|
224 | 216 | w3id: data.w3id
|
225 | 217 | });
|
226 | 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 | +
|
227 | 225 | // Step 1: Platform creates entry locally
|
228 | 226 | currentFlowStep = 1;
|
229 | 227 | flowMessages = [
|
|
504 | 502 | console.log('getEvaultIndex called with w3id:', w3id);
|
505 | 503 | console.log('selectedEVaults:', selectedEVaults);
|
506 | 504 |
|
507 |
| - // 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 |
508 | 510 | const index = selectedEVaults.findIndex((e) => {
|
509 |
| - const matches = e.evaultId === w3id; |
| 511 | + const matches = e.evaultId === cleanW3id; |
510 | 512 |
|
511 | 513 | if (matches) {
|
512 | 514 | console.log('Found matching eVault by evaultId:', e);
|
|
523 | 525 |
|
524 | 526 | // If no match found, log all available evaultIds for debugging
|
525 | 527 | if (index === -1) {
|
526 |
| - console.log('No match found for w3id:', w3id); |
| 528 | + console.log('No match found for cleaned w3id:', cleanW3id); |
527 | 529 | console.log('Available evaultIds:');
|
528 | 530 | selectedEVaults.forEach((evault, i) => {
|
529 | 531 | console.log(`eVault ${i}: evaultId = "${evault.evaultId}"`);
|
530 | 532 | });
|
531 | 533 |
|
532 |
| - // Fall back to index 0 if no match found |
533 |
| - console.log('Falling back to index 0'); |
534 |
| - return 0; |
| 534 | + // Return -1 to indicate no match found |
| 535 | + console.log('No matching eVault found, skipping visualization'); |
| 536 | + return -1; |
535 | 537 | }
|
536 | 538 |
|
537 | 539 | return index;
|
|
0 commit comments