SHA256
Доработать UI звонков и нижний тулбар
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user