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

Commite1e18aa

Browse files
Merge pull request#19 from cloudiees/alert-for-dupe-transition
Added alert message for duplicate transition
2 parents2527059 +bf7ecf4 commite1e18aa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/components/Editor.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
saveFSMAtom,
99
recentStateSave,
1010
start_state,
11+
alert
1112
}from"../lib/backend";
1213
import{useAtom,useAtomValue,useSetAtom}from"jotai";
1314
import{Nodes}from"../lib/backend";
@@ -46,6 +47,8 @@ const Editor = () => {
4647

4748
const[startState,setStartState]=useAtom(start_state);
4849

50+
constsetAlertMsg=useSetAtom(alert);
51+
4952
// Every time a state's controls are changed(size), it's transition arrows should also be updated
5053
useEffect(()=>{
5154
if(recentStateControlSaved=="nil")return;
@@ -177,6 +180,8 @@ const Editor = () => {
177180
for(consttrofnodeList[transitionTracker].transitions){
178181
if(tr.to!=null&&tr.to==id){
179182
setTransitionTracker(undefined);
183+
setAlertMsg("This transition already exists!");
184+
setTimeout(()=>setAlertMsg("nil"),3000);
180185
return;
181186
}
182187
}
@@ -521,7 +526,7 @@ const Editor = () => {
521526
// Update location of text
522527
trText.x(
523528
transitions[trNameEditor[2]].points[2]-
524-
3*trNameEditor[1].length
529+
3*trNameEditor[1].length
525530
);
526531
trText.y(transitions[trNameEditor[2]].points[3]-20);
527532

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp