Skip to content

Commit 9def353

Browse files
committed
refactor: use correctly state
1 parent 4c08c47 commit 9def353

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/js/layout/components/Collections.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getCollectionsAPI } from "../../api/requests";
55
import { app } from "../../app";
66
import { updateImgPreview } from "../../elements/addDataElement";
77
import { DRAGGABLE_GROUP_NAME } from "../../constants/constants";
8+
import { mapState } from "vuex";
89

910
const Collections = Vue.component("Collections", {
1011
data() {
@@ -23,7 +24,8 @@ const Collections = Vue.component("Collections", {
2324
group: DRAGGABLE_GROUP_NAME,
2425
ghostClass: "ghost"
2526
};
26-
}
27+
},
28+
...mapState("Interface", ["elements"])
2729
},
2830
watch: {
2931
// id(newValue) {
@@ -39,7 +41,7 @@ const Collections = Vue.component("Collections", {
3941

4042
// if doesnt exist in obj, add it
4143
if (!(boxId in this.files)) {
42-
const data = app.elementsData.find(
44+
const data = this.elements.find(
4345
({ boxId: thisBoxId }) => thisBoxId == boxId
4446
).data;
4547
const definedData = data ? [data[0]] : [];

0 commit comments

Comments
 (0)