diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-07-17 15:07:28 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-07-17 15:07:28 -0400 |
commit | 56c2063deb32302b58044181c9f3248da409bf13 (patch) | |
tree | 86ff74785b11b85f79c37853d143ed436854f598 /src/client/util/UndoManager.ts | |
parent | 84b3012d81b403c4a2a7e7517f4fdfe727464a57 (diff) | |
parent | 54547a9e69726bbacf545296d84723f902ec7097 (diff) |
Merge branch 'master' into data-visualization-sarah
Diffstat (limited to 'src/client/util/UndoManager.ts')
-rw-r--r-- | src/client/util/UndoManager.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/util/UndoManager.ts b/src/client/util/UndoManager.ts index b59af6656..9a6719ea5 100644 --- a/src/client/util/UndoManager.ts +++ b/src/client/util/UndoManager.ts @@ -1,5 +1,6 @@ import { observable, action, runInAction } from 'mobx'; import { Field } from '../../fields/Doc'; +import { RichTextField } from '../../fields/RichTextField'; import { Without } from '../../Utils'; function getBatchName(target: any, key: string | symbol): string { @@ -96,7 +97,13 @@ export namespace UndoManager { export function AddEvent(event: UndoEvent, value?: any): void { if (currentBatch && batchCounter.get() && !undoing) { - console.log(' '.slice(0, batchCounter.get()) + 'UndoEvent : ' + event.prop + ' = ' + (value instanceof Array ? value.map(val => Field.toScriptString(val)).join(',') : Field.toScriptString(value))); + console.log( + ' '.slice(0, batchCounter.get()) + + 'UndoEvent : ' + + event.prop + + ' = ' + + (value instanceof RichTextField ? value.Text : value instanceof Array ? value.map(val => Field.toScriptString(val)).join(',') : Field.toScriptString(value)) + ); currentBatch.push(event); tempEvents?.push(event); } |