Добавить предпросмотр DM в push-уведомлениях

This commit is contained in:
AidarKC
2026-11-27 15:52:51 +03:00
parent 91a8bb9c3c
commit 7d3f5db206
17 changed files with 696 additions and 31 deletions
+3 -3
View File
@@ -132,13 +132,13 @@ export class WsJsonClient {
return this.openPromise;
}
async request(op, payload = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
for (let attempt = 0; attempt < 2; attempt += 1) {
async request(op, payload = {}, timeoutMs = DEFAULT_TIMEOUT_MS, { existingOnly = false } = {}) {
for (let attempt = 0; !existingOnly && attempt < 2; attempt += 1) {
await this.open();
if (this.requestGuard) await this.requestGuard(op);
if (this.ws && this.ws.readyState === WebSocket.OPEN) break;
}
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
if (!this.ws || this.ws.readyState !== WebSocket.OPEN || (existingOnly && !this.isSessionReady())) {
throw new Error(t('remaining.websocket.websocket_connection_closed'));
}
const requestId = createRequestId(op);