(baseUrl = '/api')
| 174 | |
| 175 | class ApiClient { |
| 176 | constructor(baseUrl = '/api') { |
| 177 | this.baseUrl = baseUrl; |
| 178 | this.inflightRequests = new Map(); |
| 179 | this.activeRequestCount = 0; |
| 180 | this.maxConcurrentRequests = 6; |
| 181 | this.requestQueue = []; |
| 182 | this.networkOnline = typeof navigator === 'undefined' ? true : navigator.onLine !== false; |
| 183 | this._networkToastState = { type: '', at: 0 }; |
| 184 | this.defaultTimeoutMs = 20000; |
| 185 | this.defaultRetryCount = 1; |
| 186 | this.defaultRetryDelayMs = 900; |
| 187 | this.setupNetworkListeners(); |
| 188 | } |
| 189 | |
| 190 | getAdaptiveTimeoutMs() { |
| 191 | const connection = navigator?.connection || navigator?.mozConnection || navigator?.webkitConnection; |
nothing calls this directly
no test coverage detected