From 9d423738c4477a2881d69edc3cbddc8f89731d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Thu, 24 Jun 2021 16:24:43 +0200 Subject: [PATCH] consts uppercase. --- src/component/internal/connection.ts | 16 ++++++++-------- src/component/overlay.vue | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/component/internal/connection.ts b/src/component/internal/connection.ts index 50e33404..e195aaf9 100644 --- a/src/component/internal/connection.ts +++ b/src/component/internal/connection.ts @@ -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 { 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 { 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 { 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 { this._webrtcIsReconnecting = false this._log.debug(`webrtc reconnection finished`) - }, webrtcReconnDelay) + }, WEBRTC_RECONN_DELAY) } _webrtcQualityDowngrade(quality: string): string | undefined { diff --git a/src/component/overlay.vue b/src/component/overlay.vue index 21eafad2..d66c287b 100644 --- a/src/component/overlay.vue +++ b/src/component/overlay.vue @@ -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) {