cronofy-elements 1.46.0 → 1.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cronofy-elements",
3
- "version": "1.46.0",
3
+ "version": "1.46.1",
4
4
  "description": "Fast track scheduling with Cronofy's embeddable UI Elements",
5
5
  "main": "build/npm/CronofyElements.js",
6
6
  "scripts": {
@@ -115,17 +115,7 @@ const Wrapper = ({ options }) => {
115
115
  const allSlots = { ...slots, ...newSlots };
116
116
  setSlots(allSlots);
117
117
  const newRules = buildNewRules(allSlots);
118
- const callbackContent = {
119
- notification: {
120
- type: "availability_rule_edited",
121
- },
122
- availability_rule: {
123
- ...account,
124
- calendar_ids: calendars.active,
125
- weekly_periods: newRules,
126
- },
127
- };
128
- status.callback(callbackContent);
118
+ setRules(newRules);
129
119
  };
130
120
 
131
121
  useEffect(() => {
@@ -148,7 +138,6 @@ const Wrapper = ({ options }) => {
148
138
 
149
139
  useEffect(() => {
150
140
  if (!status.loading && !status.error) {
151
- const newRules = buildNewRules(slots);
152
141
  const callbackContent = {
153
142
  notification: {
154
143
  type: "availability_rule_edited",
@@ -156,12 +145,12 @@ const Wrapper = ({ options }) => {
156
145
  availability_rule: {
157
146
  ...account,
158
147
  calendar_ids: calendars.active,
159
- weekly_periods: newRules,
148
+ weekly_periods: rules,
160
149
  },
161
150
  };
162
151
  status.callback(callbackContent);
163
152
  }
164
- }, [calendars]);
153
+ }, [calendars, account, rules]);
165
154
 
166
155
  useEffect(() => {
167
156
  // Query the API for rules and calendars, but don't do anything until
@@ -295,10 +284,7 @@ const Wrapper = ({ options }) => {
295
284
  }, [tz.selectedTzid.tzid]);
296
285
 
297
286
  const generateRules = () => {
298
- const newRules = buildNewRules(slots);
299
-
300
- setRules(newRules);
301
- const rulesRequest = { ...account, weekly_periods: newRules };
287
+ const rulesRequest = { ...account, weekly_periods: rules };
302
288
 
303
289
  let tempStatus = status;
304
290
 
@@ -117,6 +117,7 @@ const TimeZoneSelector = ({ locale, theme, tz, setTz }) => {
117
117
  <button
118
118
  className={theme.classBuilder("timezone-selector--button")}
119
119
  id="timezone-button"
120
+ type="button"
120
121
  aria-haspopup="listbox"
121
122
  aria-label="Choose a timezone"
122
123
  aria-expanded={showList}
@@ -1019,6 +1019,7 @@ exports[`Snapshot test of Availability Rules Elements renders AvailabilityRules
1019
1019
  aria-label="Choose a timezone"
1020
1020
  class="PREFIX__timezone-selector--button AR__timezone-selector--button"
1021
1021
  id="timezone-button"
1022
+ type="button"
1022
1023
  >
1023
1024
  London
1024
1025
  <svg