fix: typos and improve naming conventions: (#8687)
This commit is contained in:
parent
8cc9e68363
commit
bef83a4d2e
14 changed files with 37 additions and 38 deletions
|
|
@ -334,9 +334,9 @@ export const useChat = (
|
|||
const newChatList = produce(chatListRef.current, (draft) => {
|
||||
const index = draft.findIndex(item => item.id === responseItem.id)
|
||||
if (index !== -1) {
|
||||
const requestion = draft[index - 1]
|
||||
const question = draft[index - 1]
|
||||
draft[index - 1] = {
|
||||
...requestion,
|
||||
...question,
|
||||
}
|
||||
draft[index] = {
|
||||
...draft[index],
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ const ImagePreview: FC<ImagePreviewProps> = ({
|
|||
})
|
||||
}
|
||||
|
||||
const imageTobase64ToBlob = (base64: string, type = 'image/png'): Blob => {
|
||||
const imageBase64ToBlob = (base64: string, type = 'image/png'): Blob => {
|
||||
const byteCharacters = atob(base64)
|
||||
const byteArrays = []
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ const ImagePreview: FC<ImagePreviewProps> = ({
|
|||
const shareImage = async () => {
|
||||
try {
|
||||
const base64Data = url.split(',')[1]
|
||||
const blob = imageTobase64ToBlob(base64Data, 'image/png')
|
||||
const blob = imageBase64ToBlob(base64Data, 'image/png')
|
||||
|
||||
await navigator.clipboard.write([
|
||||
new ClipboardItem({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue