mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add library events (#2448)
This commit is contained in:
parent
a2132c9bb7
commit
e392bebc40
7 changed files with 35 additions and 4 deletions
|
@ -3,6 +3,7 @@ import { getSelectedElements } from "../scene";
|
|||
import { getNonDeletedElements } from "../element";
|
||||
import { deepCopyElement } from "../element/newElement";
|
||||
import { Library } from "../data/library";
|
||||
import { EVENT_LIBRARY, trackEvent } from "../analytics";
|
||||
|
||||
export const actionAddToLibrary = register({
|
||||
name: "addToLibrary",
|
||||
|
@ -15,7 +16,7 @@ export const actionAddToLibrary = register({
|
|||
Library.loadLibrary().then((items) => {
|
||||
Library.saveLibrary([...items, selectedElements.map(deepCopyElement)]);
|
||||
});
|
||||
|
||||
trackEvent(EVENT_LIBRARY, "add");
|
||||
return false;
|
||||
},
|
||||
contextMenuOrder: 6,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue