Skip to content

Commit

Permalink
Don't show errors when board is disconnected and syncAuto=true
Browse files Browse the repository at this point in the history
  • Loading branch information
nilclass committed Jan 8, 2024
1 parent 62a08f3 commit 460ff52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/JumperlessState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const JumperlessState: React.FC<{ children: React.ReactNode }> = ({ child
}, [syncOnce])

useEffect(() => {
if (syncAuto) {
if (syncAuto && conn.ready) {
syncToDevice()
}
}, [syncAuto, netlist, supplySwitchPos])
Expand Down
2 changes: 1 addition & 1 deletion src/panels/ConnectionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ConnectionPanel: React.FC = () => {
<div className='content'>
<button disabled={!ready || syncAuto} onClick={syncToDevice}>Sync to device ⇒</button>
<label>
<input type='checkbox' name='syncToDeviceAuto' checked={syncAuto} onChange={e => setSyncAuto(e.currentTarget.checked)} />
<input type='checkbox' name='syncToDeviceAuto' checked={syncAuto} onChange={e => setSyncAuto(e.currentTarget.checked)} disabled={!ready} />
Sync automatically
</label>
<br />
Expand Down

0 comments on commit 460ff52

Please sign in to comment.