Skip to content

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

fix: load app even if there is network error

thecodrr80b5a2baa92f
diff --git a/apps/web/src/index.js b/apps/web/src/index.js
index 9524bd86f..a969b2727 100644
--- a/apps/web/src/index.js
+++ b/apps/web/src/index.js
@@ -9,12 +9,15 @@ import * as serviceWorker from "./serviceWorker";
import Modal from "react-modal";
import { db } from "./common";
-db.init().then(() => {
- Modal.setAppElement("#root");
- ReactDOM.render(<App />, document.getElementById("root"));
+ReactDOM.render(<span>Loading...</span>, document.getElementById("root"));
+db.init()
+ .catch(console.error)
+ .finally(() => {
+ Modal.setAppElement("#root");
+ ReactDOM.render(<App />, document.getElementById("root"));
- // If you want your app to work offline and load faster, you can change
- // unregister() to register() below. Note this comes with some pitfalls.
- // Learn more about service workers: https://bit.ly/CRA-PWA
- serviceWorker.unregister();
-});
+ // If you want your app to work offline and load faster, you can change
+ // unregister() to register() below. Note this comes with some pitfalls.
+ // Learn more about service workers: https://bit.ly/CRA-PWA
+ serviceWorker.unregister();
+ });
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index 00bc9d763..a15aa63d1 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -7307,7 +7307,7 @@ normalize-url@^3.0.0, normalize-url@^3.0.1:
"notes-core@git+ssh://[email protected]:streetwriters/notesnook-core.git":
version "1.5.0"
- resolved "git+ssh://[email protected]:streetwriters/notesnook-core.git#c9ea70d8f9c264431b49f67d77567e32c4f5b1c9"
+ resolved "git+ssh://[email protected]:streetwriters/notesnook-core.git#715d3b561e189e570c5abe1214371175bf4ebba0"
dependencies:
event-source-polyfill "^1.0.16"
fast-sort "^2.0.1"