Close canvas while streaming (#500)
This commit is contained in:
parent
24fdf181bc
commit
6801f3a236
4 changed files with 16 additions and 8 deletions
|
|
@ -429,7 +429,9 @@ export function Canvas({
|
|||
}
|
||||
)}`}
|
||||
</div>
|
||||
) : null}
|
||||
) : (
|
||||
<div className="w-32 h-3 mt-2 bg-muted-foreground/20 rounded-md animate-pulse" />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -443,6 +445,7 @@ export function Canvas({
|
|||
copyToClipboard(canvas.content);
|
||||
toast.success('Copied to clipboard!');
|
||||
}}
|
||||
disabled={canvas.status === 'streaming'}
|
||||
>
|
||||
<CopyIcon size={18} />
|
||||
</Button>
|
||||
|
|
@ -457,7 +460,9 @@ export function Canvas({
|
|||
onClick={() => {
|
||||
handleVersionChange('prev');
|
||||
}}
|
||||
disabled={currentVersionIndex === 0}
|
||||
disabled={
|
||||
currentVersionIndex === 0 || canvas.status === 'streaming'
|
||||
}
|
||||
>
|
||||
<UndoIcon size={18} />
|
||||
</Button>
|
||||
|
|
@ -472,7 +477,7 @@ export function Canvas({
|
|||
onClick={() => {
|
||||
handleVersionChange('next');
|
||||
}}
|
||||
disabled={isCurrentVersion}
|
||||
disabled={isCurrentVersion || canvas.status === 'streaming'}
|
||||
>
|
||||
<RedoIcon size={18} />
|
||||
</Button>
|
||||
|
|
@ -489,6 +494,7 @@ export function Canvas({
|
|||
onClick={() => {
|
||||
handleVersionChange('toggle');
|
||||
}}
|
||||
disabled={canvas.status === 'streaming'}
|
||||
>
|
||||
<DeltaIcon size={18} />
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue