Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc3e41b0

Browse files
committed
Added duplicate transition check
1 parent1b8d0fc commitc3e41b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/components/Editor.tsx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ const Editor = () => {
173173
setTransitionTracker(id);
174174
return;
175175
}else{
176+
// Checks if a transition between selected state(s) already exists to prevent dupe transitions
177+
for(consttrofnodeList[transitionTracker].transitions){
178+
if(tr.to!=null&&tr.to==id){
179+
setTransitionTracker(undefined);
180+
return;
181+
}
182+
}
183+
176184
constpoints=getPoints(transitionTracker,id);
177185

178186
constnewTransition={
@@ -190,7 +198,7 @@ const Editor = () => {
190198
transitions.push(newTransition);
191199
updateTransitions(transitions);
192200

193-
// Add this transition to thecorrecponding node
201+
// Add this transition to thecorresponding node
194202
nodeList[transitionTracker].transitions.push({
195203
from:undefined,
196204
to:id,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp