Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Dec 8, 2024
1 parent 55d20e4 commit 831ba98
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions JL.Windows/GUI/PreferencesWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,13 @@ private static async Task GetFields(ComboBox modelNamesComboBox, Panel miningPan
string modelName = modelNamesComboBox.SelectionBoxItem.ToString()!;

List<string>? fieldNames = await AnkiUtils.GetFieldNames(modelName).ConfigureAwait(true);

if (fieldNames is not null)
{
Dictionary<string, JLField> fields =
fieldNames.ToDictionary(static fieldName => fieldName, static _ => JLField.Nothing, StringComparer.Ordinal);
Dictionary<string, JLField> fields = new(fieldNames.Count, StringComparer.Ordinal);
for (int i = 0; i < fieldNames.Count; i++)
{
fields.Add(fieldNames[i], JLField.Nothing);
}

CreateFieldElements(fields, fieldList, miningPanel);
}
Expand Down

0 comments on commit 831ba98

Please sign in to comment.