chore: remove all comments

This commit is contained in:
thecodrr
2021-10-22 16:29:03 +05:00
parent 850259c6fb
commit 6fab9ad1f3
6 changed files with 23 additions and 34 deletions

View File

@@ -28,7 +28,6 @@ test.skip("login user and check for token", async () => {
usermanager.login(user.email, user.password)
).resolves.not.toThrow();
console.log(await usermanager.tokenManager.getToken());
await expect(usermanager.tokenManager.getToken()).resolves.toBeDefined();
}, 30000);
@@ -39,7 +38,6 @@ test.skip("login user and get user data", async () => {
await usermanager.login(user.email, user.password);
const userData = await usermanager.getUser();
console.log(userData);
expect(userData.email).toBe(process.env.EMAIL);
}, 30000);

View File

@@ -135,7 +135,6 @@ test("editing one topic should not update dateEdited of all", () =>
const newTopics = topics.all.filter((t) => t.title !== "Hello22");
//console.log(newTopics, oldTopics);
expect(
newTopics.every(
(t) =>

View File

@@ -56,7 +56,6 @@ class Database {
this
);
EV.subscribe(EVENTS.attachmentDeleted, async (attachment) => {
console.log("deleted:", attachment);
await this.fs.cancel(attachment.metadata.hash);
});
EV.subscribe(EVENTS.userLoggedOut, async () => {
@@ -140,7 +139,7 @@ class Database {
try {
var { type, data } = JSON.parse(event.data);
data = JSON.parse(data);
console.log(type, data);
// console.log(type, data);
} catch (e) {
console.log("SSE: Unsupported message. Message = ", event.data);
return;

View File

@@ -152,7 +152,6 @@ export default class Sync {
async _uploadAttachments() {
const attachments = this._db.attachments.pending;
try {
console.log("Uploading attachments", this._db.attachments.pending);
for (var i = 0; i < attachments.length; ++i) {
const attachment = attachments[i];
const { hash } = attachment.metadata;

View File

@@ -88,7 +88,6 @@ export default class Attachments extends Collection {
dateUploaded: undefined,
dateDeleted: undefined,
};
console.log("adding attachmentitem", attachmentItem);
return this._collection.addItem(attachmentItem);
}
@@ -155,7 +154,6 @@ export default class Attachments extends Collection {
markAsUploaded(id) {
const attachment = this.all.find((a) => a.id === id);
console.log("mark as uploaded", id, attachment);
if (!attachment) return;
attachment.dateUploaded = Date.now();
return this._collection.updateItem(attachment);
@@ -174,7 +172,7 @@ export default class Attachments extends Collection {
const attachments = this.images.filter((attachment) =>
hasItem(attachment.noteIds, noteId)
);
console.log("Downloading attachments", attachments);
try {
for (let i = 0; i < attachments.length; i++) {
const { hash } = attachments[i].metadata;
await this._downloadMedia(hash, {
@@ -183,11 +181,13 @@ export default class Attachments extends Collection {
groupId: noteId,
});
}
} finally {
sendAttachmentsProgressEvent("download", noteId, attachments.length);
}
}
async _downloadMedia(hash, { total, current, groupId }, notify = true) {
sendAttachmentsProgressEvent("download", groupId, total, current);
try {
const isDownloaded = await this._db.fs.downloadFile(groupId, hash);
if (!isDownloaded) return;
@@ -202,10 +202,6 @@ export default class Attachments extends Collection {
});
return src;
} finally {
if (1 + current === total)
sendAttachmentsProgressEvent("download", groupId, total);
}
}
async cleanup() {

View File

@@ -35,11 +35,9 @@ export default class FileStorage {
}
async cancel(groupId, type = undefined) {
console.trace("Cancelling", groupId, type);
const [op] = this._deleteOp(groupId, type);
if (!op) return;
await op.cancel("Operation canceled.");
console.log("Cancellation done:", groupId, this._queue);
}
_deleteOp(groupId, type = undefined) {