octokatherine / readme.so

An online drag-and-drop editor to easily build READMEs
https://readme.so
MIT License
4.24k stars 326 forks source link

Little fixes/refactoring #259

Open AlperBayraktar opened 2 years ago

AlperBayraktar commented 2 years ago

Saw this error in dev (editor page, dark mode enabled):

readme so fixed error

Reason: Since there is no window object in server load, theme is 'light' and editor's theme toggle image's alt is light. But when client page loads, window becomes defined so alt is set to 'dark'. So next throws this error because server and client pages are not same.

Fix: Load theme as light in server, and load the actual theme when page loads (when window gets defined).

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
readme-so ✅ Ready (Inspect) Visit Preview Sep 5, 2022 at 7:47PM (UTC)
Anas-Dew commented 1 year ago

Good one