-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
addresses issue #36 but does not fix it totally; helix idxs can now b…
…e changed one at a time, and not with a recalculation of view order until #407 is addressed
- Loading branch information
Showing
11 changed files
with
120 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'dart:html'; | ||
|
||
import 'package:redux/redux.dart'; | ||
import 'package:scadnano/src/state/design.dart'; | ||
|
||
import '../actions/actions.dart' as actions; | ||
import '../state/app_state.dart'; | ||
|
||
/// Check whether user wants to remove helix that has strands on it. | ||
helix_idxs_change_middleware(Store<AppState> store, dynamic action, NextDispatcher next) { | ||
if (action is actions.HelixIdxsChange) { | ||
Set<int> existing_idxs = store.state.design.helices.keys.toSet(); | ||
Set<int> old_idxs = action.idx_replacements.keys.toSet(); | ||
Set<int> remaining_idxs = existing_idxs.difference(old_idxs); | ||
for (int new_idx in action.idx_replacements.values) { | ||
if (remaining_idxs.contains(new_idx)) { | ||
var msg = 'Index ${new_idx} is already taken.'; | ||
window.alert(msg); | ||
return; | ||
} | ||
} | ||
} | ||
next(action); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters