Skip to content

Commit

Permalink
Add error to disabled state
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Mar 8, 2024
1 parent bf21437 commit f427be3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions products/jbrowse-web/src/components/ShareDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const ShareDialog = observer(function ({
})()
}, [currentSetting, error, session, url, snap])

const disabled = (currentSetting === 'short' && loading) || !!error
return (
<>
<Dialog
Expand Down Expand Up @@ -134,7 +135,7 @@ const ShareDialog = observer(function ({
<DialogActions>
<Button
startIcon={<BookmarkAddIcon />}
disabled={currentSetting === 'short' && loading}
disabled={diabled}

Check failure on line 138 in products/jbrowse-web/src/components/ShareDialog.tsx

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

'diabled' is not defined

Check warning on line 138 in products/jbrowse-web/src/components/ShareDialog.tsx

View workflow job for this annotation

GitHub Actions / Spell check

"diabled" should be "disabled".
onClick={event => {
event.preventDefault()
setPassword(passwordParam, 'replaceIn')
Expand All @@ -151,7 +152,7 @@ const ShareDialog = observer(function ({
session.notify('Copied to clipboard', 'success')
}}
startIcon={<ContentCopyIcon />}
disabled={currentSetting === 'short' && loading}
disabled={disabled}
>
Copy to Clipboard
</Button>
Expand Down

0 comments on commit f427be3

Please sign in to comment.