@shaxpir/duiduidui-models 1.25.0 → 1.25.2

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.
@@ -101,9 +101,15 @@ class Workspace extends Content_1.Content {
101
101
  this.checkDisposed("Workspace.upsertChatStub");
102
102
  const index = this._chatsView.firstIndexWhere(s => s.id === stub.id);
103
103
  if (index === 0) {
104
- // Already at the top — update fields in place
105
- this._chatsView.setObjectValueAtIndex(0, 'title', stub.title);
106
- this._chatsView.setObjectValueAtIndex(0, 'last_message_preview', stub.last_message_preview);
104
+ // Already at the top — update fields in place, but don't
105
+ // overwrite non-null values with null (async modelUpdated
106
+ // calls can race, and earlier calls may carry stale data)
107
+ if (stub.title) {
108
+ this._chatsView.setObjectValueAtIndex(0, 'title', stub.title);
109
+ }
110
+ if (stub.last_message_preview) {
111
+ this._chatsView.setObjectValueAtIndex(0, 'last_message_preview', stub.last_message_preview);
112
+ }
107
113
  this._chatsView.setObjectValueAtIndex(0, 'updated_at', stub.updated_at);
108
114
  }
109
115
  else if (index > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.25.0",
3
+ "version": "1.25.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"