Skip to content

Commit

Permalink
fix "null and selected" config
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantornRU committed Sep 25, 2024
1 parent c4c06b4 commit 5360560
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Helpers/ShowMessages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public static void NoConfigSelected()
string title = "No config selected";
string content =
"The process has been cancelled." +
"\nPlease upload the configs that will process the files, then select those that will participate in the process. " +
"\nYou can select several at once.";
"\nPlease upload the configs that will process the files, then select those that will participate in the process. ";
ShowMessageBox(title, content);
}

Expand Down
7 changes: 6 additions & 1 deletion ViewModels/Pages/StatesEditorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public void ConfigChanged(ConfigItem? config, int index)
{
Debug.WriteLine("Config nullified.");
EnvironmentController.currentConfigFullPath = string.Empty;
lastIndexConfig = -1;
return;
}
Debug.WriteLine($"Config Changed to: {config.FileName} \nPath: {config.FilePath}");
Expand Down Expand Up @@ -296,12 +297,16 @@ public async Task OnSaveConfig(CancellationToken cancellation)
}
else
{
if (lastIndexConfig == -1)
{
ShowMessages.NoConfigSelected();
return;
}
ConfigItem selectedItem = BasicListConfigViewItems[lastIndexConfig];
selectedItem.State = ConfigState.Saved;
EnvironmentController.dataPixelStorage.SavePixelStorage(fullpath);
}


}

[RelayCommand]
Expand Down

0 comments on commit 5360560

Please sign in to comment.