Updated the package version to 1.5.0 and some minor changes

canary
WolverinDEV 2020-12-02 18:23:42 +01:00
parent be9f199c03
commit 46d9ead8ba
4 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "teaspeak-web", "name": "teaspeak-web",
"version": "1.2.0", "version": "1.5.0",
"description": "Welcome here! This repository is created with two reasons:\n 1. People can bring their own ideas and follow their implementation\n 2. People can see TeaSpeak Web client progress and avoid creating repetitive issues all the time.", "description": "Welcome here! This repository is created with two reasons:\n 1. People can bring their own ideas and follow their implementation\n 2. People can see TeaSpeak Web client progress and avoid creating repetitive issues all the time.",
"scripts": { "scripts": {
"compile-project-base": "tsc -p tsbaseconfig.json", "compile-project-base": "tsc -p tsbaseconfig.json",

View File

@ -17,7 +17,7 @@ export interface CommandOptions {
export const CommandOptionDefaults: CommandOptions = { export const CommandOptionDefaults: CommandOptions = {
flagset: [], flagset: [],
process_result: true, process_result: true,
timeout: 1000 timeout: 10_000
}; };
export interface ServerConnectionEvents { export interface ServerConnectionEvents {

View File

@ -76,6 +76,12 @@ const ConnectionStateRenderer = React.memo((props: { state: ConnectionStatus, is
statusBody = <Translatable key={"healthy"}>Healthy</Translatable>; statusBody = <Translatable key={"healthy"}>Healthy</Translatable>;
break; break;
case "unsupported":
title = tr("Not supported");
statusClass = cssStyle.disconnected;
statusBody = <Translatable key={"not-supported"}>Not supported</Translatable>;
break;
default: default:
statusClass = cssStyle.unhealthy; statusClass = cssStyle.unhealthy;
statusBody = <Translatable key={"invalid-state"}>Invalid state</Translatable>; statusBody = <Translatable key={"invalid-state"}>Invalid state</Translatable>;

View File

@ -131,7 +131,7 @@ export class ServerConnection extends AbstractServerConnection {
async connect(address : ServerAddress, handshake: HandshakeHandler, timeout?: number) : Promise<void> { async connect(address : ServerAddress, handshake: HandshakeHandler, timeout?: number) : Promise<void> {
const connectBeginTimestamp = Date.now(); const connectBeginTimestamp = Date.now();
timeout = typeof(timeout) === "number" ? timeout : 5000; timeout = typeof(timeout) === "number" ? timeout : 10_000;
try { try {
await this.disconnect(); await this.disconnect();
@ -469,7 +469,7 @@ export class ServerConnection extends AbstractServerConnection {
listener.timeout = setTimeout(() => { listener.timeout = setTimeout(() => {
this.returnListeners.remove(listener); this.returnListeners.remove(listener);
listener.reject("timeout"); listener.reject("timeout");
}, 1500); }, options.timeout || 15_000);
this.returnListeners.push(listener); this.returnListeners.push(listener);
this.sendData(ServerConnection.commandDataToJson({ this.sendData(ServerConnection.commandDataToJson({