Fix history - the 2nd installment (#1014)

* don't regenerate versionNonce on pushEntry

* fix history handling around multi-point arrows

* remove filtering from getElementMap helper
This commit is contained in:
David Luzar 2020-03-19 19:41:32 +01:00 committed by GitHub
parent 1d393a4ea0
commit fda06e4fc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 13 deletions

View file

@ -41,7 +41,7 @@ export function getSyncableElements(elements: readonly ExcalidrawElement[]) {
}
export function getElementMap(elements: readonly ExcalidrawElement[]) {
return getSyncableElements(elements).reduce(
return elements.reduce(
(acc: { [key: string]: ExcalidrawElement }, element: ExcalidrawElement) => {
acc[element.id] = element;
return acc;

View file

@ -53,8 +53,8 @@ export function newElementWith<TElement extends ExcalidrawElement>(
): TElement {
return {
...element,
...updates,
version: element.version + 1,
versionNonce: randomSeed(),
...updates,
};
}