Skip to content

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

fix: make welcome note fetching origin independent

thecodrrc4971d9ccfed
diff --git a/apps/web/public/notes/index.json b/apps/web/public/notes/index.json
index ea07a013b..41ceb3cd6 100644
--- a/apps/web/public/notes/index.json
+++ b/apps/web/public/notes/index.json
@@ -2,7 +2,7 @@
{
"title": "Welcome to Notesnook!",
"headline": "Thank you for checking out Notesnook. We are so glad to have you on board!",
- "webContent": "https://app.notesnook.com/notes/welcome-web",
+ "webContent": "/notes/welcome-web",
"mobileContent": "https://app.notesnook.com/notes/welcome-mobile",
"autoOpen": true
}
diff --git a/apps/web/src/common/db.js b/apps/web/src/common/db.js
index 74c3cca9a..d139dbed9 100644
--- a/apps/web/src/common/db.js
+++ b/apps/web/src/common/db.js
@@ -58,9 +58,9 @@ async function loadDefaultNotes(db) {
if (note.autoOpen) autoOpenId = id;
}
- EV.publish(EVENTS.appRefreshRequested);
if (autoOpenId) quickNavigate(`/notes/${autoOpenId}/edit`);
setAppHydrated();
+ EV.publish(EVENTS.appRefreshRequested);
}
function quickNavigate(url) {
diff --git a/apps/web/src/stores/user-store.js b/apps/web/src/stores/user-store.js
index e1ae68664..a06e29b7d 100644
--- a/apps/web/src/stores/user-store.js
+++ b/apps/web/src/stores/user-store.js
@@ -19,6 +19,8 @@ class UserStore extends BaseStore {
lastSynced = 0;
init = () => {
+ EV.subscribe(EVENTS.appRefreshRequested, () => appStore.refresh());
+
db.user.getUser().then((user) => {
if (!user) return false;
this.set((state) => {
@@ -32,7 +34,6 @@ class UserStore extends BaseStore {
state.user = user;
state.isLoggedIn = true;
});
- EV.subscribe(EVENTS.appRefreshRequested, () => appStore.refresh());
EV.subscribe(EVENTS.userSubscriptionUpdated, (subscription) => {
this.set((state) => (state.user.subscription = subscription));
});