diff --git a/web/app.js b/web/app.js index 8ef838a5c46cd..92ab547291d99 100644 --- a/web/app.js +++ b/web/app.js @@ -3153,24 +3153,36 @@ function webViewerPostMessage(evt) { } else { ({ action, data } = evt.data); } - const filename = data.name ? `${data.name}.pdf` : "liker-land_ebook.pdf"; + const { data: fileData, name, classId, nftId, wallet } = data; + const filename = name ? `${name}.pdf` : "liker-land_ebook.pdf"; const url = `https://liker.land/${filename}`; switch (action) { case "openBase64File": PDFViewerApplication.open({ - data: atob(data.data), + data: atob(fileData), url, filename, }); break; case "openArrayBufferFile": PDFViewerApplication.open({ - data: new Uint8Array(data.data), + data: new Uint8Array(fileData), url, filename, }); break; } + if (window.Sentry) { + if (wallet) { + window.Sentry.setUser({ id: wallet }); + } + if (classId) { + window.Sentry.setTag("classId", classId); + } + if (nftId) { + window.Sentry.setTag("nftId", nftId); + } + } } catch (ex) { console.error(`webViewerPostMessage: ${ex}`); }