Skip to content

Commit 37ef1a0

Browse files
committed
Fix loading of stored design/config
see #22 (comment)
1 parent d7b1421 commit 37ef1a0

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

dist/js/field.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"/js/field.js": "/js/field.js?id=a599868661464380f9b5d69375fa963f"
2+
"/js/field.js": "/js/field.js?id=4a236deae1810202607f4b6a0e059b0c"
33
}

resources/js/components/FormField.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
/** Register listeners, load initial template, etc. */
5858
editorLoaded() {
5959
if (this.field.value !== null) {
60-
this.$refs.editor.loadDesign(this.field.value);
60+
this.$refs.editor.loadDesign(this.unProxy(this.field.value));
6161
}
6262
6363
/** @see https://docs.unlayer.com/docs/events */
@@ -69,7 +69,15 @@
6969
},
7070
7171
/**
72-
* @param {Array} pluginsUrls
72+
* @param {Proxy<Object>} proxyInstance
73+
* @return {Object}
74+
*/
75+
unProxy(proxyInstance) {
76+
return JSON.parse(JSON.stringify(proxyInstance));
77+
},
78+
79+
/**
80+
* @param {Array<string>} pluginsUrls
7381
*/
7482
loadPlugins(pluginsUrls) {
7583
if (window.unlayer.plugins === undefined) {

0 commit comments

Comments
 (0)