changed browserslist config, improved browser sleep detection

This commit is contained in:
or-else
2025-02-07 20:59:45 +03:00
parent 12a97cacc8
commit bc8f20977e
62 changed files with 705 additions and 792 deletions
+7
View File
@@ -132,3 +132,10 @@ export const CLICKABLE_URL_SCHEMES = ['http', 'https', 'ftp', 'ftps'];
// Size of the QR code in the app.
export const QRCODE_SIZE = 128;
// How much time has to pass to consider computer awoken from sleep (80 sec).
// Chrome throttles ticker events in inactive tabs to once per minute. This
// value ensures that these once-a-minute events do not trigger a reconnect.
export const WAKE_UP_TIMEOUT = 80000;
// Timer interval between checks if computer woke up from sleep (1 sec).
export const WAKE_UP_TICK = 1000;
+1 -6
View File
@@ -19,7 +19,7 @@ import MessagesView from './messages-view.jsx';
import SidepanelView from './sidepanel-view.jsx';
import { API_KEY, APP_NAME, DEFAULT_P2P_ACCESS_MODE, FORWARDED_PREVIEW_LENGTH, LOGGING_ENABLED,
MEDIA_BREAKPOINT } from '../config.js';
MEDIA_BREAKPOINT, WAKE_UP_TICK, WAKE_UP_TIMEOUT } from '../config.js';
import { CALL_STATE_NONE, CALL_STATE_OUTGOING_INITATED,
CALL_STATE_INCOMING_RECEIVED, CALL_STATE_IN_PROGRESS,
CALL_HEAD_STARTED } from '../constants.js';
@@ -34,11 +34,6 @@ import { updateFavicon } from '../lib/utils.js';
// Sound to play on message received.
const POP_SOUND = new Audio('audio/msg.m4a');
// How much time has to pass to consider conputer awoken from sleep (50 sec).
const WAKE_UP_TIMEOUT = 50000;
// Timer interval to check if computer woke up from sleep (5 sec).
const WAKE_UP_TICK = 5000;
const messages = defineMessages({
reconnect_countdown: {
id: 'reconnect_countdown',