@shaxpir/duiduidui-models 1.25.6 → 1.25.7
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/dist/models/Chat.js +9 -1
- package/package.json +1 -1
package/dist/models/Chat.js
CHANGED
|
@@ -223,7 +223,15 @@ class Chat extends SharedContent_1.SharedContent {
|
|
|
223
223
|
const expiresAt = shaxpir_common_1.Time.plus(now, durationMinutes, 'minutes');
|
|
224
224
|
const breakpoint = { ttl, created_at: now, expires_at: expiresAt };
|
|
225
225
|
const batch = new Operation_1.BatchOperation(this);
|
|
226
|
-
|
|
226
|
+
// If cache_breakpoints doesn't exist on the payload yet, create the
|
|
227
|
+
// entire object in one operation. OT can't insert into a non-existent
|
|
228
|
+
// parent, so we must create the parent first.
|
|
229
|
+
if (!this.payload.cache_breakpoints) {
|
|
230
|
+
batch.setPathValue(['payload', 'cache_breakpoints'], { [target]: breakpoint });
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
batch.setPathValue(['payload', 'cache_breakpoints', target], breakpoint);
|
|
234
|
+
}
|
|
227
235
|
batch.commit();
|
|
228
236
|
}
|
|
229
237
|
get cacheBreakpoints() {
|