Skip to content

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

feat: send event on auto vault lock

thecodrr55e87b6adf87
diff --git a/packages/core/api/vault.js b/packages/core/api/vault.js
index 0bcd59884..b59524cbd 100644
--- a/packages/core/api/vault.js
+++ b/packages/core/api/vault.js
@@ -18,6 +18,7 @@ export default class Vault {
clearTimeout(ERASER_TIMEOUT);
ERASER_TIMEOUT = setTimeout(() => {
this._password = null;
+ EV.publish(EVENTS.vaultLocked);
}, ERASE_TIME);
}
diff --git a/packages/core/common.js b/packages/core/common.js
index c3eb5cec1..001d5777e 100644
--- a/packages/core/common.js
+++ b/packages/core/common.js
@@ -50,6 +50,7 @@ export const EVENTS = {
attachmentsLoading: "attachments:loading",
attachmentDeleted: "attachment:deleted",
mediaAttachmentDownloaded: "attachments:mediaDownloaded",
+ vaultLocked: "vault:locked",
};
export const CURRENT_DATABASE_VERSION = 5.3;