Исправить синхронизацию прочитанных каналов

This commit is contained in:
AidarKC
2026-09-10 12:33:24 +03:00
parent 107f85b818
commit 4c7e71f21f
11 changed files with 125 additions and 60 deletions
+4 -2
View File
@@ -1574,13 +1574,15 @@ export class AuthService {
return response.payload || {};
}
async getChannelMessages(channel, limit = 200, sort = 'asc', login = '') {
async getChannelMessages(channel, limit = null, sort = 'asc', login = '') {
const normalizedChannel = {
ownerBlockchainName: String(channel?.ownerBlockchainName || '').trim(),
channelRootBlockNumber: Number(channel?.channelRootBlockNumber),
channelRootBlockHash: String(channel?.channelRootBlockHash || '').trim(),
};
const payload = { channel: normalizedChannel, limit, sort };
const payload = { channel: normalizedChannel, sort };
const cleanLimit = Number(limit);
if (Number.isFinite(cleanLimit) && cleanLimit > 0) payload.limit = Math.trunc(cleanLimit);
const cleanLogin = String(login || '').trim();
if (cleanLogin) payload.login = cleanLogin;
const response = await this.ws.request('GetChannelMessages', payload);