mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 22:19:41 +01:00
due to these multiple objects reset password wasn't working because only the latest one would be encrypted with the new password but all previous objects would require decryption which resulted in a block while syncing
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
import EventManager from "./utils/event-manager";
|
|
|
|
export const EV = new EventManager();
|
|
|
|
export async function sendCheckUserStatusEvent(type) {
|
|
const results = await EV.publishWithResult(EVENTS.userCheckStatus, type);
|
|
if (typeof results === "boolean") return results;
|
|
return results.some((r) => r.type === type && r.result === true);
|
|
}
|
|
|
|
export const CHECK_IDS = {
|
|
noteColor: "note:color",
|
|
noteTag: "note:tag",
|
|
noteExport: "note:export",
|
|
vaultAdd: "vault:add",
|
|
notebookAdd: "notebook:add",
|
|
backupEncrypt: "backup:encrypt",
|
|
databaseSync: "database:sync",
|
|
};
|
|
|
|
export const EVENTS = {
|
|
userCheckStatus: "user:checkStatus",
|
|
userSubscriptionUpdated: "user:subscriptionUpdated",
|
|
userEmailConfirmed: "user:emailConfirmed",
|
|
userLoggedIn: "user:loggedIn",
|
|
userLoggedOut: "user:loggedOut",
|
|
userFetched: "user:fetched",
|
|
userSignedUp: "user:signedUp",
|
|
databaseSyncRequested: "db:syncRequested",
|
|
databaseMigrated: "db:migrated",
|
|
databaseUpdated: "db:updated",
|
|
appRefreshRequested: "app:refreshRequested",
|
|
noteRemoved: "note:removed",
|
|
};
|
|
|
|
export const CURRENT_DATABASE_VERSION = 5.2;
|