gitify-app / website

The source code of gitify.io
https://www.gitify.io/
MIT License
0 stars 0 forks source link

bug: os platform detection no longer works #201

Closed setchy closed 1 month ago

setchy commented 2 months ago

OS detection no longer working to render the correct download links

https://github.com/gitify-app/website/blob/92a357d780a2258525bf8da6b2b6a9ebbeb065be/src/components/LatestRelease.astro#L52 is always returning window as undefined and defaulting to macOS download link.

Screenshot 2024-08-19 at 8 49 30 AM

This logic needs to run client-side, not server-side

afonsojramos commented 2 months ago

To solve our age old issue of fetching the latest release and knowing the client's OS what we could probably do is an Netlify Edge Function that is heavily cached.

https://docs.netlify.com/frameworks/astro/#edge-functions-examples https://docs.netlify.com/edge-functions/optional-configuration/#response-caching

afonsojramos commented 2 months ago

In the past I've tried to ship SolidJS in the client (probably in some closed PR somewhere), but the waterfall of requests just delays everything..