Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: load polyfills before everything else

Abdullah Attae3f0d0ada784
diff --git a/apps/web/src/index.tsx b/apps/web/src/index.tsx
index eff53cef5..eeeb5ed12 100644
--- a/apps/web/src/index.tsx
+++ b/apps/web/src/index.tsx
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+import "./polyfills";
import "@notesnook/core/types";
import { AppEventManager, AppEvents } from "./common/app-events";
import { render } from "react-dom";
@@ -24,9 +25,7 @@ import { getCurrentHash, getCurrentPath, makeURL } from "./navigation";
import Config from "./utils/config";
import { isTesting } from "./utils/platform";
import { initalizeLogger, logger } from "./utils/logger";
-import { Buffer } from "buffer";
import { AuthProps } from "./views/auth";
-window.Buffer = Buffer;
initalizeLogger();
diff --git a/apps/web/src/polyfills.ts b/apps/web/src/polyfills.ts
new file mode 100644
index 000000000..4aad3f7a0
--- /dev/null
+++ b/apps/web/src/polyfills.ts
@@ -0,0 +1,21 @@
+/*
+This file is part of the Notesnook project (https://notesnook.com/)
+
+Copyright (C) 2023 Streetwriters (Private) Limited
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+import { Buffer } from "buffer";
+window.Buffer = Buffer;