Skip to content

Commit

Permalink
Merge pull request #1145 from geyserfund/hot-fix/disable-tweet-insert…
Browse files Browse the repository at this point in the history
…-if-twttr-is-unavailable

fix: disable tweet insert if window.twttr is unavilable
  • Loading branch information
sajald77 authored Sep 5, 2023
2 parents 0b12cce + 6b4d9c8 commit b344d42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/forms/markdown/toolbar/ToolbarMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import { TweetCommand } from '../commands/TweetCommand'
import { VideoCommand } from '../commands/VideoCommand'

export const ToolbarMedia = ({ isDisabled }: { isDisabled?: boolean }) => {
const isTweetEnabled = Boolean(twttr?.widgets)
return (
<ButtonGroup isAttached py={1}>
<LinkCommand isDisabled={isDisabled} />
<ImageCommand isDisabled={isDisabled} />
<VideoCommand isDisabled={isDisabled} />
<TweetCommand isDisabled={isDisabled} />
{isTweetEnabled && <TweetCommand isDisabled={isDisabled} />}
</ButtonGroup>
)
}

0 comments on commit b344d42

Please sign in to comment.