Доработать UI звонков и нижний тулбар

This commit is contained in:
AidarKC
2026-08-11 13:29:29 +04:00
parent 566ea942dc
commit 628a970e6f
12 changed files with 465 additions and 91 deletions
+23
View File
@@ -180,6 +180,7 @@ let uiVersionPeriodicIntervalId = null;
let hiddenDmAudioContext = null;
let hiddenDmAudioUnlocked = false;
let initialConnectionCompleted = false;
let orientationLockInFlight = false;
const CALL_PUSH_PENDING_ACTION_KEY = 'shine-ui-call-push-pending-action-v1';
const GUEST_ALLOWED_PAGES = new Set([
'start-view',
@@ -258,6 +259,23 @@ async function playDmSignal({ extended = false } = {}) {
}
}
async function tryLockPortraitOrientation() {
if (orientationLockInFlight) return false;
const orientationApi = window.screen?.orientation;
if (!orientationApi?.lock) return false;
orientationLockInFlight = true;
try {
await orientationApi.lock('portrait');
return true;
} catch {
return false;
} finally {
orientationLockInFlight = false;
}
}
async function notifyHiddenIncomingMessage(fromLogin, text) {
const body = String(text || '').trim() || `Вам пришло сообщение от ${fromLogin}`;
const title = `Сообщение от ${fromLogin}`;
@@ -1028,6 +1046,7 @@ async function ensureSessionRuntimeStarted() {
async function init() {
consumeCallPushActionFromUrlIfAny();
void tryLockPortraitOrientation();
if (state.session.isLocalDemo) {
setConnectionStatus('connected');
@@ -1411,8 +1430,12 @@ async function init() {
}, { passive: true });
document.addEventListener('visibilitychange', () => {
if (document.visibilityState !== 'visible') return;
void tryLockPortraitOrientation();
void checkConnectionHealth();
});
window.addEventListener('orientationchange', () => {
void tryLockPortraitOrientation();
});
}
init();