mirror of
https://github.com/makecindy/cindy.git
synced 2026-12-03 23:49:51 +08:00
fix(provider-share): 拒绝能力与关闭状态矛盾的响应
Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user