added tab control to chat, When user leaves tab open on chat

This commit is contained in:
NigeParis 2025-11-26 14:41:21 +01:00
parent 40980bedeb
commit 422c0b26c4
9 changed files with 151 additions and 119 deletions

View file

@ -16,7 +16,6 @@
import * as runtime from '../runtime';
import type {
ChatTest200Response,
ChatTest500Response,
DisableOtp200Response,
DisableOtp401Response,
DisableOtp500Response,
@ -50,8 +49,6 @@ import type {
import {
ChatTest200ResponseFromJSON,
ChatTest200ResponseToJSON,
ChatTest500ResponseFromJSON,
ChatTest500ResponseToJSON,
DisableOtp200ResponseFromJSON,
DisableOtp200ResponseToJSON,
DisableOtp401ResponseFromJSON,
@ -135,7 +132,7 @@ export class OpenapiOtherApi extends runtime.BaseAPI {
/**
*/
async chatTestRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatTest200Response | StatusOtp401Response | ChatTest500Response>> {
async chatTestRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatTest200Response | StatusOtp401Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
@ -162,19 +159,15 @@ export class OpenapiOtherApi extends runtime.BaseAPI {
// Object response for status 401
return new runtime.JSONApiResponse(response, (jsonValue) => StatusOtp401ResponseFromJSON(jsonValue));
}
if (response.status === 500) {
// Object response for status 500
return new runtime.JSONApiResponse(response, (jsonValue) => ChatTest500ResponseFromJSON(jsonValue));
}
// CHANGED: Throw error if status code is not handled by any of the defined responses
// This ensures all code paths return a value and provides clear error messages for unexpected status codes
// Only throw if responses were defined but none matched the actual status code
throw new runtime.ResponseError(response, `Unexpected status code: ${response.status}. Expected one of: 200, 401, 500`);
throw new runtime.ResponseError(response, `Unexpected status code: ${response.status}. Expected one of: 200, 401`);
}
/**
*/
async chatTest(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatTest200Response | StatusOtp401Response | ChatTest500Response> {
async chatTest(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatTest200Response | StatusOtp401Response> {
const response = await this.chatTestRaw(initOverrides);
return await response.value();
}