Fix issue with creating unnamed collections.

This commit is contained in:
Ottermandias 2024-06-01 20:28:43 +02:00
parent aba68cfb92
commit 5101b73fdc
2 changed files with 4 additions and 1 deletions

View file

@ -153,6 +153,9 @@ public class CollectionStorage : IReadOnlyList<ModCollection>, IDisposable
/// </summary>
public bool AddCollection(string name, ModCollection? duplicate)
{
if (name.Length == 0)
return false;
var newCollection = Create(name, _collections.Count, duplicate);
_collections.Add(newCollection);
_saveService.ImmediateSave(new ModCollectionSave(_modStorage, newCollection));

View file

@ -109,7 +109,7 @@ public sealed class CollectionSelector : ItemSelector<ModCollection>, IDisposabl
}
private string Name(ModCollection collection)
=> IncognitoMode ? collection.AnonymizedName : collection.Name;
=> IncognitoMode || collection.Name.Length == 0 ? collection.AnonymizedName : collection.Name;
private void OnCollectionChange(CollectionType type, ModCollection? old, ModCollection? @new, string _3)
{