fix: make welcome note fetching origin independent

This commit is contained in:
thecodrr
2021-04-17 11:03:38 +05:00
parent e62a30213c
commit c4971d9ccf
3 changed files with 4 additions and 3 deletions

View File

@@ -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
}

View File

@@ -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) {

View File

@@ -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));
});