diff --git a/src/add/array.js b/src/add/array.js index 8530bd99..bf43b37c 100644 --- a/src/add/array.js +++ b/src/add/array.js @@ -224,8 +224,9 @@ String.prototype.reverse = function() { }; Object.clone = function(o) { - return structuredClone(o); - // return o ? JSON.parse(JSON.stringify(o)) : o; + // not using structuredClone because failes with some objects + // this method "cleans" out non clonables + return o ? JSON.parse(JSON.stringify(o)) : o; }; Object.toArray = function(o) { diff --git a/src/kiri/settings.js b/src/kiri/settings.js index 84086f14..3ca25603 100644 --- a/src/kiri/settings.js +++ b/src/kiri/settings.js @@ -500,7 +500,7 @@ function settingsImport(data, ask) { const { uc, ui } = api; if (typeof(data) === 'string') { try { - data = api.util.b64dec(data); + data = data.charAt(0) === '{' ? JSON.parse(data) : api.util.b64dec(data); } catch (e) { uc.alert('invalid import format'); console.log('data',data,{type: typeof data},e);