diff --git a/apps/OpenSign/src/App.js b/apps/OpenSign/src/App.js index 452f9a061..fb244a436 100644 --- a/apps/OpenSign/src/App.js +++ b/apps/OpenSign/src/App.js @@ -30,11 +30,7 @@ const Opensigndrive = lazy(() => import("./pages/Opensigndrive")); const ManageSign = lazy(() => import("./pages/Managesign")); const GenerateToken = lazy(() => import("./pages/GenerateToken")); const Webhook = lazy(() => import("./pages/Webhook")); - -pdfjs.GlobalWorkerOptions.workerSrc = new URL( - "pdfjs-dist/legacy/build/pdf.worker.min.mjs", - import.meta.url -).toString(); +pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.min.mjs`; const AppLoader = () => { return (
diff --git a/apps/OpenSign/src/index.js b/apps/OpenSign/src/index.js index f11064560..3f3131a15 100644 --- a/apps/OpenSign/src/index.js +++ b/apps/OpenSign/src/index.js @@ -16,7 +16,6 @@ import { import DragElement from "./components/pdf/DragElement"; import TagManager from "react-gtm-module"; import Parse from "parse"; -import './polyfills' const appId = process.env.REACT_APP_APPID ? process.env.REACT_APP_APPID : "opensign"; diff --git a/apps/OpenSign/src/polyfills.js b/apps/OpenSign/src/polyfills.js deleted file mode 100644 index fb63675d1..000000000 --- a/apps/OpenSign/src/polyfills.js +++ /dev/null @@ -1,16 +0,0 @@ -// below code is used to handle undefined Promise.withResolvers for safari -if (typeof Promise.withResolvers === "undefined") { - Promise.withResolvers = function () { - let resolve, reject; - const promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - return { promise, resolve, reject }; - }; -} - -// Usage: -// const { promise, resolve, reject } = Promise.withResolvers() -// console.log(promise, resolve, reject) // Promise { } [Function (anonymous)] [Function (anonymous)] -// ... Do something async and then call resolve or reject! \ No newline at end of file