This commit is contained in:
Simon Knott 2025-02-10 17:15:22 +01:00
parent ce6563f332
commit 1f59565219
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -42,7 +42,7 @@ const PromptButton: React.FC<{
}> = ({ error, actions }) => { }> = ({ error, actions }) => {
const [pageSnapshot, setPageSnapshot] = React.useState<string>(); const [pageSnapshot, setPageSnapshot] = React.useState<string>();
React.useEffect(( )=> { React.useEffect(() => {
for (const action of actions) { for (const action of actions) {
for (const attachment of action.attachments ?? []) { for (const attachment of action.attachments ?? []) {
if (attachment.name === 'pageSnapshot') { if (attachment.name === 'pageSnapshot') {
@ -57,12 +57,12 @@ const PromptButton: React.FC<{
const gitCommitInfo = useGitCommitInfo(); const gitCommitInfo = useGitCommitInfo();
const prompt = React.useMemo( const prompt = React.useMemo(
() => fixTestPrompt( () => fixTestPrompt(
error, error,
gitCommitInfo?.['pull.diff'] ?? gitCommitInfo?.['revision.diff'], gitCommitInfo?.['pull.diff'] ?? gitCommitInfo?.['revision.diff'],
pageSnapshot pageSnapshot
), ),
[error, gitCommitInfo, pageSnapshot] [error, gitCommitInfo, pageSnapshot]
); );
return ( return (
@ -70,7 +70,7 @@ const PromptButton: React.FC<{
value={prompt} value={prompt}
description='Fix with AI' description='Fix with AI'
copiedDescription={<>Copied <span className='codicon codicon-copy' style={{ marginLeft: '5px' }}/></>} copiedDescription={<>Copied <span className='codicon codicon-copy' style={{ marginLeft: '5px' }}/></>}
style={{ width: '90px', justifyContent: 'center' }} style={{ width: '90px', justifyContent: 'center' }}
/> />
); );
}; };