mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 19:33:11 +02:00
Desktop connection SaaS: config, billing, team support (#5768)
Co-authored-by: James Brunton <[email protected]> Co-authored-by: James Brunton <[email protected]>
This commit is contained in:
co-authored by
James Brunton
James Brunton
parent
86072ec91a
commit
5c39acecd8
@@ -1,6 +1,7 @@
|
||||
import i18n from '@app/i18n';
|
||||
import { alert } from '@app/components/toast';
|
||||
import { tauriBackendService } from '@app/services/tauriBackendService';
|
||||
import { operationRouter } from '@app/services/operationRouter';
|
||||
|
||||
const BACKEND_TOAST_COOLDOWN_MS = 4000;
|
||||
let lastBackendToast = 0;
|
||||
@@ -8,8 +9,22 @@ let lastBackendToast = 0;
|
||||
/**
|
||||
* Desktop-specific guard that ensures the embedded backend is healthy
|
||||
* before tools attempt to call any API endpoints.
|
||||
* Enhanced to skip checks for endpoints routed to SaaS backend.
|
||||
*
|
||||
* @param endpoint - Optional endpoint path to check if it needs local backend
|
||||
* @returns true if backend is ready OR endpoint will be routed to SaaS
|
||||
*/
|
||||
export async function ensureBackendReady(): Promise<boolean> {
|
||||
export async function ensureBackendReady(endpoint?: string): Promise<boolean> {
|
||||
// Skip waiting if endpoint will be routed to SaaS backend
|
||||
if (endpoint) {
|
||||
const skipCheck = await operationRouter.shouldSkipBackendReadyCheck(endpoint);
|
||||
if (skipCheck) {
|
||||
console.debug('[backendReadinessGuard] Skipping backend ready check (SaaS routing)');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check local backend health
|
||||
if (tauriBackendService.isBackendHealthy()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user