SHA256
Добавить предпросмотр DM в push-уведомлениях
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { dmPreviewLockName } from './dm-preview-settings.js';
|
||||
import { buildAvatarReference } from './avatar-reference.js';
|
||||
import { WsJsonClient } from './ws-client.js';
|
||||
import { invalidateConnectionsGraphCache } from './connections-graph-cache.js';
|
||||
@@ -1302,6 +1303,14 @@ export class AuthService {
|
||||
|
||||
|
||||
async resumeSession(login, preferredSessionId = '') {
|
||||
const sessionId = preferredSessionId || (await loadSessionMaterial(login))?.sessionId;
|
||||
if (sessionId && globalThis.navigator?.locks?.request) {
|
||||
return navigator.locks.request(dmPreviewLockName(sessionId), () => this.resumeSessionUnlocked(login, preferredSessionId));
|
||||
}
|
||||
return this.resumeSessionUnlocked(login, preferredSessionId);
|
||||
}
|
||||
|
||||
async resumeSessionUnlocked(login, preferredSessionId = '') {
|
||||
const cleanLogin = (login || '').trim();
|
||||
if (!cleanLogin) throw new Error('Нет login для авто-входа');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user