RhysSullivan / shiptalkers

https://shiptalkers.dev
699 stars 35 forks source link

Copy Image button not working #65

Closed iqfareez closed 3 months ago

iqfareez commented 3 months ago

Screenshot 2024-06-07 at 9 17 17 AM

The button is not copying the image or anything.

Workaround:

Right click and copy the image

Screenshot 2024-06-07 at 9 18 41 AM

maxdemaio commented 3 months ago

Edit: I checked and this is the error in the console when you try to copy and it fails:

copying image:  TypeError: Failed to execute 'write' on 'Clipboard': Failed to convert value to 'ClipboardItem'.
    at i (page-2e3ad86e47b7f0bc.js:1:15451)
    at Object.a_ (b0ed1f52-fb19c9133dc2a0f4.js:1:72145)
    at aR (b0ed1f52-fb19c9133dc2a0f4.js:1:72299)
    at b0ed1f52-fb19c9133dc2a0f4.js:1:139238
    at sF (b0ed1f52-fb19c9133dc2a0f4.js:1:139337)
    at sM (b0ed1f52-fb19c9133dc2a0f4.js:1:139751)
    at b0ed1f52-fb19c9133dc2a0f4.js:1:145894
    at o4 (b0ed1f52-fb19c9133dc2a0f4.js:1:93334)
    at iV (b0ed1f52-fb19c9133dc2a0f4.js:1:122699)
    at sU (b0ed1f52-fb19c9133dc2a0f4.js:1:141059)

When I place a breakpoint, I do see the src attribute in props:

/api/og/compare?github=maxdemaio&displayName=Max+DeMaio&twitter=maxwelldemaio&commits=993&tweets=558

But I'm wondering if it's an issue with the useQuery when the data isn't there on the server.

After I verified the image was there at https://shiptalkers.dev/api/og/compare?github=maxdemaio&displayName=Max%20DeMaio&twitter=maxwelldemaio&commits=993&tweets=558, then the copy button started working.

But, when it's not working and you visit the src in props, the url is https://shiptalkers.dev/api/og/compare?github=maxdemaio&displayName=Max+DeMaio&twitter=maxwelldemaio&commits=3572&tweets=2894&avatar=https://pbs.twimg.com/profile_images/1560444267671310336/xTpwh43e_normal.jpg%22 and image moreso looks like this: h

image

will look more into this tomorrow

RhysSullivan commented 3 months ago

i think the fix is to use chrome

RhysSullivan commented 3 months ago

probably fixed by theo's PR, please reopen if still occuring