Disable diff for no changes (#501)

This commit is contained in:
Jeremy 2024-11-07 01:24:40 +03:00 committed by GitHub
parent 6801f3a236
commit 22a09de6e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -488,13 +488,18 @@ export function Canvas({
<TooltipTrigger asChild>
<Button
variant="outline"
className={cx('p-2 h-fit dark:hover:bg-zinc-700', {
'bg-muted': mode === 'diff',
})}
className={cx(
'p-2 h-fit !pointer-events-auto dark:hover:bg-zinc-700',
{
'bg-muted': mode === 'diff',
}
)}
onClick={() => {
handleVersionChange('toggle');
}}
disabled={canvas.status === 'streaming'}
disabled={
canvas.status === 'streaming' || currentVersionIndex === 0
}
>
<DeltaIcon size={18} />
</Button>