@stoker-platform/web-app 0.5.215 → 0.5.216
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/Form.tsx +8 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/Form.tsx
CHANGED
|
@@ -4183,7 +4183,7 @@ function RecordForm({
|
|
|
4183
4183
|
}
|
|
4184
4184
|
|
|
4185
4185
|
const onValid = () => {
|
|
4186
|
-
if (!isServerReadOnly) {
|
|
4186
|
+
if (!(serverWrite || isServerReadOnly)) {
|
|
4187
4187
|
if (onSuccess) onSuccess({ ...recordToSave, id: docId, Collection_Path: path } as StokerRecord)
|
|
4188
4188
|
}
|
|
4189
4189
|
}
|
|
@@ -4211,6 +4211,8 @@ function RecordForm({
|
|
|
4211
4211
|
|
|
4212
4212
|
if (isServerReadOnly) {
|
|
4213
4213
|
setIsAddingServer(false)
|
|
4214
|
+
}
|
|
4215
|
+
if (serverWrite || isServerReadOnly) {
|
|
4214
4216
|
if (onSuccess)
|
|
4215
4217
|
onSuccess({ ...recordToSave, id: docId, Collection_Path: path } as StokerRecord)
|
|
4216
4218
|
}
|
|
@@ -4276,7 +4278,11 @@ function RecordForm({
|
|
|
4276
4278
|
return
|
|
4277
4279
|
}
|
|
4278
4280
|
const serverWrite = isServerUpdate(collection, { ...recordToSave, id }, userData)
|
|
4279
|
-
const optimisticUpdate = {
|
|
4281
|
+
const optimisticUpdate = {
|
|
4282
|
+
...(originalRecord ?? record),
|
|
4283
|
+
...cloneDeep(recordToSave),
|
|
4284
|
+
id,
|
|
4285
|
+
} as StokerRecord
|
|
4280
4286
|
setOptimisticUpdate(labels.collection, optimisticUpdate)
|
|
4281
4287
|
|
|
4282
4288
|
setGlobalLoading("+", id, serverWrite, !(serverWrite || isServerReadOnly))
|