Skip to content

Commit

Permalink
CELE-32 fix: Fix blank canvas initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsobspinto committed Jul 17, 2024
1 parent 5ff0f01 commit b7a7fa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ const Neurons = () => {
}));

// Transform active neurons data to the format expected by CustomListItem
const neuronList = Array.from(activeNeurons).map(neuronName => {
const neuronList = activeNeurons? Array.from(activeNeurons).map(neuronName => {
const neuron = availableNeurons[neuronName];
return {
id: neuron.name,
label: neuron.name,
checked: true,
};
});
}) : [];

// Handle activation and deactivation of neurons
const handleSwitchChange = (neuronName: string, checked: boolean) => {
Expand Down
5 changes: 4 additions & 1 deletion applications/visualizer/frontend/src/models/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Workspace {
this.name = name;
this.activeDatasets = {};
this.availableNeurons = {};
this.activeNeurons = activeNeurons;
this.activeNeurons = activeNeurons || new Set();
this.highlightedNeuron = undefined;
this.viewers = {
[ViewerType.Graph]: true,
Expand Down Expand Up @@ -134,6 +134,9 @@ export class Workspace {
}

async _initializeActiveDatasets(datasetIds: Set<string>) {
if (!datasetIds) {
return;
}
const datasets = await fetchDatasets(datasetIds);
const updated: Workspace = produce(this, (draft: Workspace) => {
draft.activeDatasets = datasets;
Expand Down

0 comments on commit b7a7fa9

Please sign in to comment.