cronofy-elements
Advanced tools
Comparing version 1.17.0 to 1.17.1
{ | ||
"name": "cronofy-elements", | ||
"version": "1.17.0", | ||
"version": "1.17.1", | ||
"description": "Fast track scheduling with Cronofy's embeddable UI Elements", | ||
@@ -5,0 +5,0 @@ "main": "build/npm/CronofyElements.js", |
// import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import merge from "deepmerge"; | ||
@@ -65,3 +64,2 @@ import Error from "../components/generic/Error"; | ||
const reload = newRawOptions => { | ||
console.log("newRawOptions", newRawOptions); | ||
// Increment the key - this will ensure the React | ||
@@ -77,4 +75,28 @@ // component re-renders when the `options` change. | ||
return { | ||
update: newOptions => reload(merge(originalOptions, newOptions)) | ||
update: newOptions => { | ||
let updatedOptions = { | ||
...originalOptions, | ||
...newOptions | ||
}; | ||
if (newOptions.config) { | ||
updatedOptions.config = { | ||
...originalOptions.config, | ||
...newOptions.config | ||
}; | ||
} | ||
if (newOptions.availability_query) { | ||
updatedOptions.availability_query = { | ||
...originalOptions.availability_query, | ||
...newOptions.availability_query | ||
}; | ||
} | ||
if (newOptions.styles) { | ||
updatedOptions.styles = { | ||
...originalOptions.styles, | ||
...newOptions.styles | ||
}; | ||
} | ||
return reload(updatedOptions); | ||
} | ||
}; | ||
}; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2664637
24317