Merge branch 'dev'

This commit is contained in:
thororen1234 2026-04-05 16:07:29 -04:00
commit 078515ed99
No known key found for this signature in database

View file

@ -252,10 +252,24 @@ export default definePlugin({
],
async start() {
const channels = ChannelStore.getSortedPrivateChannels();
for (const channel of channels) {
if (!MessageStore.getLastMessage(channel.id)) {
await MessageActions.fetchMessages({ channelId: channel.id, limit: 1 });
const channels = ChannelStore.getSortedPrivateChannels()
.slice(0, 25)
.filter(c => !MessageStore.getLastMessage(c.id));
for (let i = 0; i < channels.length; i += 5) {
const batch = channels.slice(i, i + 5);
await Promise.allSettled(
batch.map(channel =>
MessageActions.fetchMessages({
channelId: channel.id,
limit: 1
})
)
);
if (i + 5 < channels.length) {
await new Promise(r => setTimeout(r, 3000));
}
}
},