Skip to content

Commit ab1d796

Browse files
authored
fix: json timestamp bug (#4337)
1 parent c35b87a commit ab1d796

File tree

1 file changed

+12
-0
lines changed
  • src/writeData/subscriptions/utils

1 file changed

+12
-0
lines changed

src/writeData/subscriptions/utils/form.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ export const sanitizeForm = (form: Subscription): Subscription => {
4444
}
4545
})
4646
}
47+
if (form.jsonTimestamp.path) {
48+
const startChar = form.jsonTimestamp.path.charAt(0)
49+
const newVal = checkJSONPathStarts$(startChar, form.jsonTimestamp.path)
50+
51+
if (newVal) {
52+
form.jsonTimestamp.path = newVal
53+
}
54+
}
55+
56+
if (form.jsonTimestamp.path === '') {
57+
delete form.jsonTimestamp
58+
}
4759
if (form.stringMeasurement) {
4860
form.stringMeasurement.pattern = form.stringMeasurement.pattern.replace(
4961
/\\\\/g,

0 commit comments

Comments
 (0)