重新构建dev产物(消息首页会话预览修复)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
2ee8bac6a0
commit
150db2fc02
@@ -17951,6 +17951,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.selfRef = react__WEBPACK_IMPORTED_MODULE_0___default().createRef();
|
||||
this.previewPrefetchAttempted = new Set();
|
||||
this.state = this.getBlankState();
|
||||
this.handleResize = this.handleResize.bind(this);
|
||||
this.handleHashRoute = this.handleHashRoute.bind(this);
|
||||
@@ -18801,6 +18802,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
newState.topicSelectedAcs = c.acs;
|
||||
}
|
||||
});
|
||||
this.prefetchLatestMessagePreviews(newState.chatList);
|
||||
const past = new Date(0);
|
||||
newState.chatList.sort((a, b) => {
|
||||
const pins = me.pinnedTopicRank(b.topic) - me.pinnedTopicRank(a.topic);
|
||||
@@ -18809,6 +18811,20 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
||||
newState.searchableContacts = TinodeWeb.prepareSearchableContacts(newState.chatList, this.state.searchResults);
|
||||
this.setState(newState);
|
||||
}
|
||||
prefetchLatestMessagePreviews(chatList) {
|
||||
if (!this.tinode.isConnected()) {
|
||||
return;
|
||||
}
|
||||
for (const c of chatList) {
|
||||
if (!c.topic || c.seq <= 0 || c.latestMessage() || this.previewPrefetchAttempted.has(c.topic)) {
|
||||
continue;
|
||||
}
|
||||
this.previewPrefetchAttempted.add(c.topic);
|
||||
c.subscribe(c.startMetaQuery().withLaterData(1).build()).catch(err => {
|
||||
console.warn(`Failed to prefetch latest message for '${c.topic}'`, err);
|
||||
});
|
||||
}
|
||||
}
|
||||
static checkIfPinsUpdated(me, chatList) {
|
||||
for (let i = 0; i < chatList.length; i++) {
|
||||
const c = chatList[i];
|
||||
|
||||
Reference in New Issue
Block a user