Skip to content

Commit c4fa65a

Browse files
committed
minor
1 parent 0300414 commit c4fa65a

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

lib/src/middleware/oxview_update_view.dart

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,6 @@ import '../constants.dart' as constants;
2727
import 'oxdna_export.dart';
2828
import '../app.dart';
2929

30-
// Helper function to check for unassigned DNA and show warning
31-
void _check_and_show_unassigned_dna_warning(List<Strand> strands_to_export) {
32-
List<String> strand_names_without_dna = [];
33-
for (var strand in strands_to_export) {
34-
if (strand.dna_sequence == null || strand.dna_sequence!.contains(constants.DNA_BASE_WILDCARD)) {
35-
if (strand.name != null) {
36-
strand_names_without_dna.add(strand.name!);
37-
} else {
38-
strand_names_without_dna.add(strand.id);
39-
}
40-
}
41-
}
42-
43-
if (strand_names_without_dna.isNotEmpty) {
44-
var msg =
45-
'The following strands do not have complete DNA sequences assigned: '
46-
'${strand_names_without_dna.join(", ")}. '
47-
'These strands will be exported with a default sequence of "T" '
48-
'for each nucleotide whose base is not specified. '
49-
'This can lead to unexpected behavior in oxView. For best results, '
50-
'assign a DNA sequence to each strand before exporting.'
51-
'\n\nTo silence this warning, uncheck View→Warnings→Unassigned DNA if oxView open.';
52-
window.alert(msg);
53-
}
54-
}
55-
5630
// This middleware handles sending the new design to the oxview viewer,
5731
// as well as updating whether it is shown, since it is wired to the
5832
// view outside of React.
@@ -136,3 +110,29 @@ void update_oxview_view(Design design, IFrameElement? frame, bool warn_enabled)
136110

137111
frame.contentWindow?.postMessage(message, constants.OXVIEW_URL);
138112
}
113+
114+
// Helper function to check for unassigned DNA and show warning
115+
void _check_and_show_unassigned_dna_warning(List<Strand> strands_to_export) {
116+
List<String> strand_names_without_dna = [];
117+
for (var strand in strands_to_export) {
118+
if (strand.dna_sequence == null || strand.dna_sequence!.contains(constants.DNA_BASE_WILDCARD)) {
119+
if (strand.name != null) {
120+
strand_names_without_dna.add(strand.name!);
121+
} else {
122+
strand_names_without_dna.add(strand.id);
123+
}
124+
}
125+
}
126+
127+
if (strand_names_without_dna.isNotEmpty) {
128+
var msg =
129+
'The following strands do not have complete DNA sequences assigned: '
130+
'${strand_names_without_dna.join(", ")}. '
131+
'These strands will be exported with a default sequence of "T" '
132+
'for each nucleotide whose base is not specified. '
133+
'This can lead to unexpected behavior in oxView. For best results, '
134+
'assign a DNA sequence to each strand before exporting.'
135+
'\n\nTo silence this warning, uncheck View→Warnings→Unassigned DNA if oxView open.';
136+
window.alert(msg);
137+
}
138+
}

lib/src/view/oxview.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class OxviewViewComponent {
1919
..attributes = {
2020
'height': '100%',
2121
'width': '100%',
22-
'src': 'https://sulcgroup.github.io/oxdna-viewer/',
22+
'src': constants.OXVIEW_URL,
2323
'id': 'oxview-frame',
2424
};
2525
this.div.children.add(this.frame);

0 commit comments

Comments
 (0)