Skip to content

Commit

Permalink
fixed_copytoclipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ishandutta2007 committed May 13, 2023
1 parent e07c451 commit f26af9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/content-script/ChatGPTFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ThumbsdownIcon, ThumbsupIcon, CopyIcon, CheckIcon } from '@primer/octicons-react'
import { memo, useCallback, useState } from 'react'
import { CheckIcon, CopyIcon, ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react'
import { useEffect } from 'preact/hooks'
import { memo, useCallback, useState } from 'react'
import Browser from 'webextension-polyfill'

interface Props {
messageId: string
conversationId: string
answerText: string
latestAnswerText: string
}

function ChatGPTFeedback(props: Props) {
Expand Down Expand Up @@ -46,9 +46,9 @@ function ChatGPTFeedback(props: Props) {
}, [action, props.conversationId, props.messageId])

const clickCopyToClipboard = useCallback(async () => {
await navigator.clipboard.writeText(props.answerText)
await navigator.clipboard.writeText(props.latestAnswerText)
setCopied(true)
}, [props.answerText])
}, [props.latestAnswerText])

useEffect(() => {
if (copied) {
Expand Down

0 comments on commit f26af9e

Please sign in to comment.