Skip to content

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

Merge branch 'master' into attachments

thecodrrb6a559196634
diff --cc packages/core/api/index.js
index 375da43ee,57b1436b5..5bbb2c9ad
--- a/packages/core/api/index.js
+++ b/packages/core/api/index.js
@@@ -20,7 -19,7 +20,8 @@@ import UserManager from "./user-manager
import http from "../utils/http";
import Monographs from "./monographs";
import Offers from "./offers";
+import Attachments from "../collections/attachments";
+ import Debug from "./debug";
/**
* @type {EventSource}
@@@ -51,12 -49,9 +52,13 @@@ class Database
async init() {
EV.subscribeMulti(
[EVENTS.userLoggedIn, EVENTS.userFetched, EVENTS.tokenRefreshed],
- this.connectSSE.bind(this)
+ this.connectSSE,
+ this
);
+ EV.subscribe(EVENTS.attachmentDeleted, async (attachment) => {
+ console.log("deleted:", attachment);
+ await this.fs.cancel(attachment.metadata.hash);
+ });
EV.subscribe(EVENTS.userLoggedOut, async () => {
await this.monographs.deinit();
clearTimeout(this._syncTimeout);