Skip to content

Commit

Permalink
log setText data to console
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSurana committed Dec 27, 2023
1 parent 223878c commit 95fd2b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hackerrank/firepad",
"description": "Collaborative text editing powered by Firebase",
"version": "0.8.4-dev-7",
"version": "0.8.4-dev-8",
"author": {
"email": "bprogyan@gmail.com",
"name": "Progyan Bhattacharya",
Expand Down
8 changes: 4 additions & 4 deletions src/firebase-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,13 @@ export class FirebaseAdapter implements IDatabaseAdapter {
Utils.validateFalse(this._ready, "Should not be called multiple times.");

if (!this._initialRevisions) {
this._initialRevisions = true;
this._trigger(FirebaseAdapterEvent.InitialRevision);

console.log(
`[firepad] ${this._questionId} _handleInitialRevisions FirebaseAdapterEvent.InitialRevision`,
`[firepad] ${this._questionId} _handleInitialRevisions trigger() FirebaseAdapterEvent.InitialRevision`,
{ timestamp: Date.now() }
);

this._initialRevisions = true;
this._trigger(FirebaseAdapterEvent.InitialRevision);
}

// Compose the checkpoint and all subsequent revisions into a single operation to apply at once.
Expand Down
7 changes: 7 additions & 0 deletions src/monaco-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,13 @@ export class MonacoAdapter implements IEditorAdapter {
return;
}

console.log(`[firepad] setText`, {
range: model.getFullModelRange(),
newText: text,
oldText: model.getValue(),
timestamp: Date.now(),
});

model.applyEdits([
{
range: model.getFullModelRange(),
Expand Down

0 comments on commit 95fd2b9

Please sign in to comment.