Skip to content

Commit

Permalink
Add Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 authored and williamchong committed Oct 3, 2024
1 parent d87199c commit 3837ca0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3153,19 +3153,21 @@ function webViewerPostMessage(evt) {
} else {
({ action, data } = evt.data);
}
const filename = data.name ? `${data.name}.pdf` : "liker-land_ebook.pdf";
const url = `https://liker.land/${filename}`;
switch (action) {
case "openBase64File":
PDFViewerApplication.open({
data: atob(data.data),
originalUrl: data.name,
filename: data.name ? `${data.name}.pdf` : "liker-land_ebook.pdf",
url,
filename,
});
break;
case "openArrayBufferFile":
PDFViewerApplication.open({
data: new Uint8Array(data.data),
originalUrl: data.name,
filename: data.name ? `${data.name}.pdf` : "liker-land_ebook.pdf",
url,
filename,
});
break;
}
Expand Down
4 changes: 4 additions & 0 deletions web/viewer-snippet.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!-- This snippet is used in production (included from viewer.html) -->
<link rel="resource" type="application/l10n" href="locale/locale.json">
<script
src="https://js.sentry-cdn.com/e214bf98fc5b536dea2fa999bcc2670e.min.js"
crossorigin="anonymous"
></script>
<script src="../build/pdf.mjs" type="module"></script>

0 comments on commit 3837ca0

Please sign in to comment.