mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 14:09:34 +01:00
Merge branch 'master' into attachments
This commit is contained in:
19
packages/core/api/debug.js
Normal file
19
packages/core/api/debug.js
Normal file
@@ -0,0 +1,19 @@
|
||||
export default class Debug {
|
||||
strip(item) {
|
||||
return JSON.stringify({
|
||||
title: !!item.title,
|
||||
description: !!item.description,
|
||||
headline: !!item.headline,
|
||||
colored: !!item.color,
|
||||
type: item.type,
|
||||
notebooks: item.notebooks,
|
||||
tags: item.tags,
|
||||
id: item.id,
|
||||
contentId: item.contentId,
|
||||
dateEdited: item.dateEdited,
|
||||
dateDeleted: item.dateDeleted,
|
||||
dateCreated: item.dateCreated,
|
||||
additionalData: item.additionalData,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ 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,7 +52,8 @@ 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);
|
||||
@@ -81,6 +83,7 @@ class Database {
|
||||
this.outbox = new Outbox(this);
|
||||
this.monographs = new Monographs(this);
|
||||
this.offers = new Offers();
|
||||
this.debug = new Debug();
|
||||
|
||||
// collections
|
||||
/** @type {Notes} */
|
||||
|
||||
Reference in New Issue
Block a user