mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 19:10:47 +02:00
Fix any type usage in desktop/ (#6033)
# Description of Changes Follow on from #5949, expanding any type usage ban to the `desktop/` folder Also gets rid of a bunch of really verbose desktop logging that I don't think we really need anymore (or ever needed tbh, most of it doesn't make sense) because it was using a bunch of `any` typing and wasn't worth fixing.
This commit is contained in:
@@ -200,11 +200,14 @@ export class EndpointAvailabilityService {
|
||||
const data = await response.json();
|
||||
const now = Date.now();
|
||||
|
||||
Object.entries(data).forEach(([endpoint, details]: [string, any]) => {
|
||||
const available = details?.enabled ?? false;
|
||||
this.localCache.set(endpoint, available);
|
||||
this.localCacheExpiry.set(endpoint, now + this.CACHE_DURATION);
|
||||
});
|
||||
Object.entries(data).forEach(
|
||||
([endpoint, details]: [string, unknown]) => {
|
||||
const available =
|
||||
(details as { enabled?: boolean })?.enabled ?? false;
|
||||
this.localCache.set(endpoint, available);
|
||||
this.localCacheExpiry.set(endpoint, now + this.CACHE_DURATION);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
console.warn(
|
||||
`[endpointAvailabilityService] Failed to preload endpoints: ${response.status}`,
|
||||
@@ -313,5 +316,5 @@ export const endpointAvailabilityService = new EndpointAvailabilityService();
|
||||
|
||||
// Expose to window for debugging
|
||||
if (typeof window !== "undefined") {
|
||||
(window as any).endpointAvailabilityService = endpointAvailabilityService;
|
||||
window.endpointAvailabilityService = endpointAvailabilityService;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user