diff --git a/apps/desktop/src/main/device-link/__tests__/providerShareInsights.test.ts b/apps/desktop/src/main/device-link/__tests__/providerShareInsights.test.ts index 3a3c5f06a5..3c73991792 100644 --- a/apps/desktop/src/main/device-link/__tests__/providerShareInsights.test.ts +++ b/apps/desktop/src/main/device-link/__tests__/providerShareInsights.test.ts @@ -437,6 +437,12 @@ describe('provider share insights', () => { // #4317520064:ready+null 曾让已展开明细永久加载,原覆盖没有状态/数据矛盾。 for (const capability of ['quota', 'usage'] as const) { expect(parseProviderShareInsights({ ...view, [capability]: null })).toBeNull(); + // #4318099606:开启能力却标 disabled 同样会使展开明细永久加载。 + expect(parseProviderShareInsights({ + ...view, + status: { ...view.status, [capability]: 'disabled' }, + [capability]: null, + })).toBeNull(); } const parsed = parseProviderShareInsights({ ...view, diff --git a/apps/desktop/src/shared/providerShareInsights.ts b/apps/desktop/src/shared/providerShareInsights.ts index c1dd9a236f..9e38f6048f 100644 --- a/apps/desktop/src/shared/providerShareInsights.ts +++ b/apps/desktop/src/shared/providerShareInsights.ts @@ -150,7 +150,8 @@ export function parseProviderShareInsights(raw: unknown): ProviderShareInsights if (!value.capabilities[key]) { value[key] = null; value.status[key] = 'disabled'; - } else if (value.status[key] !== 'ready') value[key] = null; + } else if (value.status[key] === 'disabled') return null; + else if (value.status[key] !== 'ready') value[key] = null; else if (value[key] === null) return null; } return value;