diff options
| author | bobzel <zzzman@gmail.com> | 2023-07-10 09:32:52 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2023-07-10 09:32:52 -0400 |
| commit | a60fbbe02f0ff26ef04ce8b44695a82673164270 (patch) | |
| tree | f923817e4713cd8b577e456c4f45183d1dcb7ce5 /src/client | |
| parent | 0007d043f7f27ce7d1103198ecb0e95e81362619 (diff) | |
updated how Lists and Docs get updated when they contain an ObjectField that will be modified
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/DocServer.ts | 2 | ||||
| -rw-r--r-- | src/client/views/ScriptingRepl.tsx | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts index 67be96d13..5b452b95b 100644 --- a/src/client/DocServer.ts +++ b/src/client/DocServer.ts @@ -198,7 +198,7 @@ export namespace DocServer { export namespace Control { let _isReadOnly = false; export function makeReadOnly() { - if (!Control.isReadOnly()) { + if (!_isReadOnly) { _isReadOnly = true; _CreateField = field => (_cache[field[Id]] = field); _UpdateField = emptyFunction; diff --git a/src/client/views/ScriptingRepl.tsx b/src/client/views/ScriptingRepl.tsx index 5dfe10def..2bc2d5e6b 100644 --- a/src/client/views/ScriptingRepl.tsx +++ b/src/client/views/ScriptingRepl.tsx @@ -5,6 +5,7 @@ import * as React from 'react'; import { DocumentManager } from '../util/DocumentManager'; import { CompileScript, Transformer, ts } from '../util/Scripting'; import { ScriptingGlobals } from '../util/ScriptingGlobals'; +import { undoable } from '../util/UndoManager'; import { DocumentIconContainer } from './nodes/DocumentIcon'; import { OverlayView } from './OverlayView'; import './ScriptingRepl.scss'; @@ -161,7 +162,7 @@ export class ScriptingRepl extends React.Component { this.commands.push({ command: this.commandString, result: script.errors }); return; } - const result = script.run({ args: this.args }, e => this.commands.push({ command: this.commandString, result: e.toString() })); + const result = undoable(() => script.run({ args: this.args }, e => this.commands.push({ command: this.commandString, result: e.toString() })), 'run:' + this.commandString)(); if (result.success) { this.commands.push({ command: this.commandString, result: result.result }); this.commandsHistory.push(this.commandString); |
