Skip to content

Commit 8546b51

Browse files
authored
Fix/control panel button issue (#310)
* fix: button * chore: fix control panel storage selection * chore: fix control panel evault selection * hotfix: issue with eVault
1 parent ae93eec commit 8546b51

File tree

1 file changed

+16
-14
lines changed
  • infrastructure/control-panel/src/routes/monitoring

1 file changed

+16
-14
lines changed

infrastructure/control-panel/src/routes/monitoring/+page.svelte

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@
5353
return;
5454
}
5555
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-
6456
// Create nodes from selected items
6557
const newNodes: Node[] = [];
6658
let nodeId = 1;
@@ -224,6 +216,12 @@
224216
w3id: data.w3id
225217
});
226218
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+
227225
// Step 1: Platform creates entry locally
228226
currentFlowStep = 1;
229227
flowMessages = [
@@ -504,9 +502,13 @@
504502
console.log('getEvaultIndex called with w3id:', w3id);
505503
console.log('selectedEVaults:', selectedEVaults);
506504
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
508510
const index = selectedEVaults.findIndex((e) => {
509-
const matches = e.evaultId === w3id;
511+
const matches = e.evaultId === cleanW3id;
510512
511513
if (matches) {
512514
console.log('Found matching eVault by evaultId:', e);
@@ -523,15 +525,15 @@
523525
524526
// If no match found, log all available evaultIds for debugging
525527
if (index === -1) {
526-
console.log('No match found for w3id:', w3id);
528+
console.log('No match found for cleaned w3id:', cleanW3id);
527529
console.log('Available evaultIds:');
528530
selectedEVaults.forEach((evault, i) => {
529531
console.log(`eVault ${i}: evaultId = "${evault.evaultId}"`);
530532
});
531533
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;
535537
}
536538
537539
return index;

0 commit comments

Comments
 (0)