mobile app chat notifications theme

This commit is contained in:
2026-02-27 22:09:52 +08:00
parent 4cd4b6ef52
commit 1d7d451c60
3 changed files with 60 additions and 3 deletions

View File

@@ -332,6 +332,19 @@ document.addEventListener('DOMContentLoaded', () => {
if (params.get('room_id')) {
setTimeout(() => selectRoom(parseInt(params.get('room_id'))), 500);
}
if (params.get('dm')) {
const dmUserId = parseInt(params.get('dm'));
setTimeout(async () => {
try {
const res = await fetch(`/api/chat/private/${dmUserId}`, { method: 'POST' });
const data = await res.json();
if (data.success) {
await loadRooms();
selectRoom(data.room_id);
}
} catch(e) { console.error('打开私聊失败', e); }
}, 500);
}
if (params.get('tab') === 'notif') {
switchTab('notif');
}