Connection: Fix reconnect logic being called on sync (#3840)
This commit is contained in:
parent
fb614840f6
commit
aa2c065eef
@ -221,17 +221,19 @@ function onUpdateConnectionState<T extends GlobalState>(
|
|||||||
};
|
};
|
||||||
setGlobal(global);
|
setGlobal(global);
|
||||||
|
|
||||||
const channelStackIds = Object.values(global.byTabId)
|
if (global.isSynced) {
|
||||||
.flatMap((tab) => tab.messageLists)
|
const channelStackIds = Object.values(global.byTabId)
|
||||||
.map((messageList) => messageList.chatId)
|
.flatMap((tab) => tab.messageLists)
|
||||||
.filter((chatId) => {
|
.map((messageList) => messageList.chatId)
|
||||||
const chat = global.chats.byId[chatId];
|
.filter((chatId) => {
|
||||||
return chat && (isChatChannel(chat) || isChatSuperGroup(chat));
|
const chat = global.chats.byId[chatId];
|
||||||
});
|
return chat && (isChatChannel(chat) || isChatSuperGroup(chat));
|
||||||
if (connectionState === 'connectionStateReady' && channelStackIds.length) {
|
});
|
||||||
unique(channelStackIds).forEach((chatId) => {
|
if (connectionState === 'connectionStateReady' && channelStackIds.length) {
|
||||||
actions.requestChannelDifference({ chatId });
|
unique(channelStackIds).forEach((chatId) => {
|
||||||
});
|
actions.requestChannelDifference({ chatId });
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connectionState === 'connectionStateBroken') {
|
if (connectionState === 'connectionStateBroken') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user