Skip to content

Commit

Permalink
refactor: remove debug logs on report save
Browse files Browse the repository at this point in the history
  • Loading branch information
dsouza95 committed Jan 19, 2024
1 parent d01a78a commit 198fb77
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
7 changes: 0 additions & 7 deletions src/syncfusion/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,18 @@ export class IaraSyncfusionEditorContentManager {
}

private async _getPlainTextContent(): Promise<string> {
console.log(`_getPlainTextContent0`, this._isPlainTextDirty);
if (this._isPlainTextDirty) {
this._isPlainTextDirty = false;
this._plainText = await this._editor
.saveAsBlob("Txt")
.then((blob: Blob) => blob.text());
}
console.log(
`_getPlainTextContent1`,
this._isPlainTextDirty,
await this._plainText
);
if (!this._plainText) throw new Error("Invalid plain text content");

return this._plainText;
}

private _onContentChange(): void {
console.log(`_onContentChange`);
this._isPlainTextDirty = true;
this._isSfdtDirty = true;
}
Expand Down
4 changes: 0 additions & 4 deletions src/syncfusion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ export class IaraSyncfusionAdapter
private async _saveReport(): Promise<void> {
const contentDate = new Date();
this._contentDate = contentDate;
console.log(`_saveReport`, contentDate);

const element = document.querySelector(".e-de-status-bar");
if (element) {
Expand All @@ -255,17 +254,14 @@ export class IaraSyncfusionAdapter
element.insertBefore(this.savingReportSpan, element.firstChild);
}

console.log(`_saveReport1`, contentDate);
const content: string[] = await Promise.all([
this._contentManager.getPlainTextContent(),
this._contentManager.getHtmlContent(),
]);
console.log(`_saveReport2`, contentDate, this._contentDate, content);

if (contentDate !== this._contentDate) return;

await this._updateReport(content[0], content[1]);
console.log(`_saveReport3`, contentDate, this._contentDate, content);
this.savingReportSpan.innerText = "Salvo";
}

Expand Down

0 comments on commit 198fb77

Please sign in to comment.