Skip to content

Commit

Permalink
Fixes sort order when displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmukai committed Feb 16, 2023
1 parent 7c1dc71 commit 00e612a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/seedsigner/models/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@ def get_multiselect_value_display_names(self, attr_name: str) -> List[str]:
raise Exception(f"Unsupported SettingsEntry.type: {settings_entry.type}")

display_names = []
for value in self._data[attr_name]:
display_names.append(settings_entry.get_selection_option_display_name_by_value(value))
# Iterate through the selection_options list in order to preserve intended sort
# order when adding which options are selected.
for value, display_name in settings_entry.selection_options:
if value in self._data[attr_name]:
display_names.append(display_name)
return display_names


Expand Down

0 comments on commit 00e612a

Please sign in to comment.