Skip to content

Commit 229eca6

Browse files
committed
chore: update to latest oscd-api version
1 parent eaf4afb commit 229eca6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"typescript": "^5.6.2"
5353
},
5454
"dependencies": {
55-
"@openscd/oscd-api": "^0.1.5"
55+
"@openscd/oscd-api": "^0.1.6"
5656
},
5757
"prettier": {
5858
"singleQuote": true,

src/XMLEditor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
Transactor,
88
} from '@openscd/oscd-api';
99

10-
const EMPTY_COMMIT: Commit<EditV2> = { undo: [], redo: [] };
10+
const EMPTY_COMMIT: Commit<EditV2> = { undo: [], redo: [], time: Date.now() };
1111

1212
export class XMLEditor implements Transactor<EditV2> {
1313
past: Commit<EditV2>[] = [];
@@ -20,7 +20,7 @@ export class XMLEditor implements Transactor<EditV2> {
2020
const commit: Commit<EditV2> =
2121
squash && this.past.length
2222
? this.past[this.past.length - 1]
23-
: { undo: [], redo: [] };
23+
: { undo: [], redo: [], time: Date.now() };
2424
const undo = handleEdit(change);
2525
// typed as per https://github.com/microsoft/TypeScript/issues/49280#issuecomment-1144181818 recommendation:
2626
commit.undo.unshift(...[undo].flat(Infinity as 1));

0 commit comments

Comments
 (0)