Skip to content

Commit

Permalink
fixes bug with setting extension name when no extensions are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-doty committed Dec 22, 2023
1 parent 760fb4a commit 1840933
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/src/view/design_main_strand_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,16 @@ class DesignMainExtensionComponent extends UiComponent2<DesignMainExtensionProps
if (results == null) return;

String name = (results[name_idx] as DialogText).value;
app.dispatch(actions.BatchAction(
app.state.ui_state.selectables_store.selected_extensions
.map((e) => actions.SubstrandNameSet(name: name, substrand: e)),
"set extension names"));
var selected_exts = app.state.ui_state.selectables_store.selected_extensions;
var action;
if (selected_exts.length > 1) {
action = actions.BatchAction(
selected_exts.map((e) => actions.SubstrandNameSet(name: name, substrand: e)),
"set extension names");
} else {
action = actions.SubstrandNameSet(name: name, substrand: props.ext);
}
app.dispatch(action);
}

extension_display_length_and_angle_change() =>
Expand Down

0 comments on commit 1840933

Please sign in to comment.