Skip to content

Commit f6bc21c

Browse files
authored
Merge pull request #51 from a8cteam51/fix/gh48-ensure-hash-is-not-recreated-if-set
ensure that if we have a hash, we do not create a new one as this cau…
2 parents 47e760a + 90363cb commit f6bc21c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/blocks/event-info/event-manager.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ const createDateHash = (start, end, postId) => {
5656
export const dateManager = (initialDates = [], timezone = '', metaSync = null) => {
5757
// lOOP through dates and add a hash to each date
5858
initialDates.dates.forEach(date => {
59-
date.hash = createDateHash(date.start_date, date.end_date);
59+
// If date has a hash and its not empty, skip
60+
if (date.hash && date.hash !== '') {
61+
return;
62+
}
63+
64+
date.hash = date.id && date.id !== ''
65+
? createDateHash(date.start_date, date.end_date, date.id)
66+
: createDateHash(date.start_date, date.end_date);
6067
});
6168

6269
// Internal state

0 commit comments

Comments
 (0)