From d5ced7ca147ec1cfdc310f0e04b0ebdc4a2ffbc9 Mon Sep 17 00:00:00 2001 From: fmfsaisai Date: Tue, 20 Oct 2026 03:48:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(provider-share):=20=E6=8B=92=E7=BB=9D?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E4=B8=8E=E5=85=B3=E9=97=AD=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=9F=9B=E7=9B=BE=E7=9A=84=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fmfsaisai --- .../device-link/__tests__/providerShareInsights.test.ts | 6 ++++++ apps/desktop/src/shared/providerShareInsights.ts | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) 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;