(core) Fix bug where a newly-created doc allows undo, which breaks it

Test Plan: Added a check to an existing test.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2665
This commit is contained in:
Dmitry S 2020-11-17 08:59:41 -05:00
parent ab01ce495d
commit c042935c58

View File

@ -413,7 +413,9 @@ export class ActiveDoc extends EventEmitter {
* Adds a small table to start off a newly-created blank document.
*/
public addInitialTable(docSession: OptDocSession) {
return this._applyUserActions(docSession, [["AddEmptyTable"]]);
// Use a non-client-specific session, so that this action is not part of anyone's undo history.
const newDocSession = makeExceptionalDocSession('nascent');
return this._applyUserActions(newDocSession, [["AddEmptyTable"]]);
}
/**