Skip to content

Commit

Permalink
Fix PDF generation Share call.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrizagidulin committed Mar 14, 2024
1 parent 5f38c29 commit 4dc8afb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/screens/PublicLinkScreen/PublicLinkScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ export default function PublicLinkScreen ({ navigation, route }: PublicLinkScree

useEffect(() => {
const fetchData = async () => {
const raw_pdf = await convertSVGtoPDF(credential);
setPdf(raw_pdf);
console.log('---------');
console.log(raw_pdf);
console.log(typeof(raw_pdf));
console.log('---------');
if (raw_pdf !== null) {
let rawPdf;
try {
rawPdf = await convertSVGtoPDF(credential);
setPdf(rawPdf);
} catch (e) {
console.log('ERROR GENERATING PDF:');
console.log(e);
}
if (rawPdf !== null) {
setShowExportToPdfButton(true);
}
};
Expand All @@ -74,7 +76,7 @@ export default function PublicLinkScreen ({ navigation, route }: PublicLinkScree

const handleShareAsPdf = async() => {
if (pdf) {
Share.open({url: `file://${pdf.filepath}`});
Share.open({url: `file://${pdf.filePath}`});

Check failure on line 79 in app/screens/PublicLinkScreen/PublicLinkScreen.tsx

View workflow job for this annotation

GitHub Actions / lint (20.x)

Property 'filePath' does not exist on type 'PDF'. Did you mean 'filepath'?
}
};

Expand Down

0 comments on commit 4dc8afb

Please sign in to comment.