mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
rename setCurrentUser to onUserUpdated
This commit is contained in:
@@ -109,10 +109,10 @@ export const useAppEvents = () => {
|
|||||||
EV.subscribe(EVENTS.mediaAttachmentDownloaded, onMediaDownloaded);
|
EV.subscribe(EVENTS.mediaAttachmentDownloaded, onMediaDownloaded);
|
||||||
EV.subscribe(EVENTS.attachmentsLoading, onLoadingAttachmentProgress);
|
EV.subscribe(EVENTS.attachmentsLoading, onLoadingAttachmentProgress);
|
||||||
|
|
||||||
eSubscribeEvent('userLoggedIn', setCurrentUser);
|
eSubscribeEvent('userLoggedIn', onUserUpdated);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
eUnSubscribeEvent('userLoggedIn', setCurrentUser);
|
eUnSubscribeEvent('userLoggedIn', onUserUpdated);
|
||||||
EV.unsubscribe(EVENTS.userSessionExpired, onSessionExpired);
|
EV.unsubscribe(EVENTS.userSessionExpired, onSessionExpired);
|
||||||
EV.unsubscribe(EVENTS.appRefreshRequested, onSyncComplete);
|
EV.unsubscribe(EVENTS.appRefreshRequested, onSyncComplete);
|
||||||
EV.unsubscribe(EVENTS.databaseSyncRequested, onRequestPartialSync);
|
EV.unsubscribe(EVENTS.databaseSyncRequested, onRequestPartialSync);
|
||||||
@@ -145,7 +145,7 @@ export const useAppEvents = () => {
|
|||||||
if (url?.startsWith('https://app.notesnook.com/account/verified')) {
|
if (url?.startsWith('https://app.notesnook.com/account/verified')) {
|
||||||
await onEmailVerified();
|
await onEmailVerified();
|
||||||
}
|
}
|
||||||
await setCurrentUser();
|
await onUserUpdated();
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
})();
|
})();
|
||||||
refValues.current.removeInternetStateListener =
|
refValues.current.removeInternetStateListener =
|
||||||
@@ -288,8 +288,8 @@ export const useAppEvents = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const setCurrentUser = async login => {
|
const onUserUpdated = async login => {
|
||||||
console.log(`setCurrentUser: ${login}`);
|
console.log(`onUserUpdated: ${login}`);
|
||||||
let user;
|
let user;
|
||||||
try {
|
try {
|
||||||
user = await db.user.getUser();
|
user = await db.user.getUser();
|
||||||
|
|||||||
Reference in New Issue
Block a user