feat(dm): implement signed direct messaging with web push fallback

This commit is contained in:
ai5590
2026-04-12 19:34:55 +03:00
parent 1ee2a1cf62
commit 62e55dbaec
21 changed files with 875 additions and 189 deletions
+6 -2
View File
@@ -1,6 +1,6 @@
import { renderHeader } from '../components/header.js';
import { directMessages } from '../mock-data.js';
import { addChatMessage, getChatMessages, authService } from '../state.js';
import { addChatMessage, getChatMessages, authService, state } from '../state.js';
export const pageMeta = { id: 'chat-view', title: 'Чат' };
@@ -66,7 +66,11 @@ export function render({ navigate, route }) {
renderLog(log, chatId);
try {
await authService.sendDirectMessage(chatId, text);
await authService.sendDirectMessage({
toLogin: chatId,
text,
storagePwd: state.session.storagePwdInMemory,
});
} catch (e) {
addChatMessage(chatId, `Ошибка отправки: ${e.message || 'unknown'}`);
renderLog(log, chatId);