Skip to content

Commit

Permalink
added pdfUrl back
Browse files Browse the repository at this point in the history
  • Loading branch information
prtkjakhar committed Sep 21, 2023
1 parent 84c1c07 commit fd2a6d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions apps/amakrushi/src/components/HistoryPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ const HistoryPage: NextPage = () => {
});
// console.log(response.data)
const pdfUrl = response.data.pdfUrl;
window.open(pdfUrl)
// window.open(pdfUrl)
const blob = new Blob([response.data], { type: 'application/pdf' });
const file = new File([blob], 'Chat.pdf', { type: blob.type });
if (type === 'download') {
toast.success(`${t('message.downloading')}`);
const link = document.createElement('a');
// link.href = pdfUrl;
link.target = "_blank";
link.href = window.URL.createObjectURL(blob);
link.href = pdfUrl;
// link.target = "_blank";
// link.href = window.URL.createObjectURL(blob);
link.download = 'Chat.pdf';
link.click();
} else if (type === 'share') {
Expand Down
8 changes: 4 additions & 4 deletions apps/amakrushi/src/components/NavBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ function NavBar() {
}
});
const pdfUrl = response.data.pdfUrl;
window.open(pdfUrl)
// window.open(pdfUrl)

const blob = new Blob([response.data], { type: 'application/pdf' });
const file = new File([blob], 'Chat.pdf', {type: blob.type});

if (type === 'download') {
toast.success(`${t('message.downloading')}`);
const link = document.createElement('a');
// link.href = pdfUrl;
link.target = "_blank";
link.href = window.URL.createObjectURL(blob);
link.href = pdfUrl;
// link.target = "_blank";
// link.href = window.URL.createObjectURL(blob);
link.download = 'Chat.pdf';
link.click();
} else if (type === 'share') {
Expand Down

0 comments on commit fd2a6d7

Please sign in to comment.