fix: unblock startup on network and external font
- Make license status snapshot non-blocking (revocation check in background) - Speed boot by not awaiting license network and capping editor ready wait - Stop disabling GPU by default on Win packaged builds - Remove external font fetch; bundle local Inter Made-with: Cursor
This commit is contained in:
@@ -113,12 +113,17 @@ export class LicenseService {
|
||||
return normalizeLicenseTokenInput(token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Онлайн-проверка отзыва. Не вызывать через `await` из UI-пути: без VPN/DNS до сервера
|
||||
* лицензий TCP может висеть до таймаута (см. fetch), из‑за чего главное окно долго «чёрное».
|
||||
*/
|
||||
private async maybeRefreshRemoteRevocation(payload: LicensePayloadV1): Promise<void> {
|
||||
const base = process.env.DND_LICENSE_STATUS_URL?.trim();
|
||||
if (!base) return;
|
||||
const now = Date.now();
|
||||
if (now - this.lastRemoteRevokeCheckMs < 60_000) return;
|
||||
this.lastRemoteRevokeCheckMs = now;
|
||||
const wasRevoked = this.lastRemoteRevoked;
|
||||
try {
|
||||
const u = new URL('v1/status', base.endsWith('/') ? base : `${base}/`);
|
||||
u.searchParams.set('sub', payload.sub);
|
||||
@@ -129,6 +134,9 @@ export class LicenseService {
|
||||
} catch {
|
||||
/* offline: не блокируем */
|
||||
}
|
||||
if (wasRevoked !== this.lastRemoteRevoked) {
|
||||
emitLicenseStatusChanged();
|
||||
}
|
||||
}
|
||||
|
||||
getStatusSync(): LicenseSnapshot {
|
||||
@@ -212,7 +220,8 @@ export class LicenseService {
|
||||
};
|
||||
}
|
||||
|
||||
async getStatus(): Promise<LicenseSnapshot> {
|
||||
/** Снимок для UI/IPC: без ожидания сети (проверка отзыва уходит в фон). */
|
||||
getStatus(): LicenseSnapshot {
|
||||
if (this.isSkipLicense()) return this.getStatusSync();
|
||||
const base = this.getStatusSync();
|
||||
if (!base.active || !base.summary) return base;
|
||||
@@ -223,7 +232,7 @@ export class LicenseService {
|
||||
deviceId: this.deviceId,
|
||||
});
|
||||
if (!v.ok) return this.getStatusSync();
|
||||
await this.maybeRefreshRemoteRevocation(v.payload);
|
||||
void this.maybeRefreshRemoteRevocation(v.payload);
|
||||
return this.getStatusSync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user