@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.
- package/dist/models/Workspace.js +9 -3
- package/package.json +1 -1
package/dist/models/Workspace.js
CHANGED
|
@@ -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
|
-
|
|
106
|
-
|
|
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) {
|