Fix library dnd (#2314)

This commit is contained in:
David Luzar 2020-10-30 21:01:41 +01:00 committed by GitHub
parent 8a50916ef2
commit ba3f548b91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 261 additions and 168 deletions

View file

@ -2,7 +2,7 @@ import { register } from "./register";
import { getSelectedElements } from "../scene";
import { getNonDeletedElements } from "../element";
import { deepCopyElement } from "../element/newElement";
import { loadLibrary, saveLibrary } from "../data/localStorage";
import { Library } from "../data/library";
export const actionAddToLibrary = register({
name: "addToLibrary",
@ -12,8 +12,8 @@ export const actionAddToLibrary = register({
appState,
);
loadLibrary().then((items) => {
saveLibrary([...items, selectedElements.map(deepCopyElement)]);
Library.loadLibrary().then((items) => {
Library.saveLibrary([...items, selectedElements.map(deepCopyElement)]);
});
return false;