cms
cms copied to clipboard
Notes not getting downloaded
Clicking on the download button opens a new tab but nothing downloads Tried in chrome
@hkirat the problem is it works on local setup. Cant really figure out what is going wrong 😞
hmm got it
Will try to check what might be going wrong in prod, as it was working fine locally
@hkirat upon reading about the issue, I figured out that relative path fails to download file in production. You need to provide the absolute url of the notion doc. On changing the <Link href={/pdf/${id}} target="_blank"> to <Link href={${notion_doc_url} target="_blank"}> in the NotionRenderer.tsx should solve the issue in production.
The application currently utilizes an external link to facilitate the downloading of content as a PDF. This method requires users to navigate away from the app, potentially leading to a disjointed user experience and may be causing the issue as @dyaipayan22 suggested
I propose implementing an in-app PDF generation and download feature using react-to-print. This solution involves: Using useRef to directly reference the content that needs to be printed. Employing useReactToPrint for on-the-fly PDF generation and download, triggered by a button within the app. I have implemented the solution locally
Keeps users within the app, streamlining the process of converting content into a PDF.
Hey I have implemented the following as well, can I raise a PR @hkirat. @neeshant-pandey if you are not raising I will do it. Thanks
https://github.com/code100x/cms/assets/55043383/2d084854-50f3-45c4-a45c-a62f6fe375d1
Hi @Neon-20 I am raising a PR. Thanks!
Sure Go Ahead @neeshant-pandey
@hkirat @devsargam notes get download in mozilla. Also on local chrome issue is replicated. https://stackoverflow.com/questions/6460630/close-window-automatically-after-printing-dialog-closes This explains the reason. Adding a pr with fix
The reason the issue was not found in local is most likely because the note is small and hence the function works before closing. https://app.100xdevs.com/courses/3/234/258 Try this in chrome, it also get downloaded in production.
seems like this is fixed now?