consts uppercase.

This commit is contained in:
Miroslav Šedivý 2021-06-24 16:24:43 +02:00
parent 6e92022c37
commit 9d423738c4
2 changed files with 10 additions and 10 deletions

View File

@ -7,11 +7,11 @@ import { NekoWebSocket } from './websocket'
import { NekoWebRTC, WebRTCStats } from './webrtc'
import { Connection } from '../types/state'
const websocketTimer = 1000
const websocketReconnDelay = 750
const WEBSOCKET_TIMEOUT = 1000
const WEBSOCKET_RECONN_DELAY = 750
const webrtcTimer = 10000
const webrtcReconnDelay = 750
const WEBRTC_TIMEOUT = 10000
const WEBRTC_RECONN_DELAY = 750
export interface NekoConnectionEvents {
disconnect: (error?: Error) => void
@ -154,7 +154,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
const timeout = window.setTimeout(() => {
this.websocket.disconnect()
rej(new Error('timeouted'))
}, websocketTimer)
}, WEBSOCKET_TIMEOUT)
this.websocket.once('connected', () => {
window.clearTimeout(timeout)
res()
@ -188,7 +188,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
this._websocketIsReconnecting = false
this._log.debug(`websocket reconnection finished`)
}, websocketReconnDelay)
}, WEBSOCKET_RECONN_DELAY)
}
async _webrtcConnect(video?: string) {
@ -203,7 +203,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
const timeout = window.setTimeout(() => {
this.webrtc.disconnect()
rej(new Error('timeouted'))
}, webrtcTimer)
}, WEBRTC_TIMEOUT)
this.webrtc.once('connected', () => {
window.clearTimeout(timeout)
res()
@ -241,7 +241,7 @@ export class NekoConnection extends EventEmitter<NekoConnectionEvents> {
this._webrtcIsReconnecting = false
this._log.debug(`webrtc reconnection finished`)
}, webrtcReconnDelay)
}, WEBRTC_RECONN_DELAY)
}
_webrtcQualityDowngrade(quality: string): string | undefined {

View File

@ -39,7 +39,7 @@
import { NekoWebRTC } from './internal/webrtc'
import { Scroll } from './types/state'
const inactiveCursorWin10 =
const INACTIVE_CURSOR =
'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACEUlEQVR4nOzWz6sSURQH8O+89zJ5C32LKbAgktCSaPpBSL' +
'uSNtHqLcOV+BeIGxei0oCtFME/wI0bF4GCK6mNuAghH7xFlBAO7bQoA/Vik3riyghTaCQzTsLzbIZZDPdzzj3nzt3Df44dYDsBRNSYTqcn5XL5KoADy1VERL' +
'Is02g0+phIJG4BsFkOEEVxjhgOh59kWb5rKWIBWCAGg0EnFovdtgyhB+grkU6n7wA4ZzlgCWKzlVgGsLQnVgE2gVh7xvP5PH9ciUajFQDHyWTyHQDVKOS3+F' +
@ -84,7 +84,7 @@
get cursor(): string {
if (!this.isControling) {
return inactiveCursorWin10
return INACTIVE_CURSOR
}
if (!this.cursorImage) {