feat: add optional minified check displaying

This commit is contained in:
divocat
2025-10-14 17:51:14 +03:00
parent 45bd2d0499
commit d39ee3a666
2 changed files with 19 additions and 4 deletions

View File

@@ -1,10 +1,20 @@
import { IDiagnosticsChecksStoreItem, store } from '../../../store';
export function updateDiagnosticsCheck(check: IDiagnosticsChecksStoreItem) {
export function updateDiagnosticsCheck(
check: IDiagnosticsChecksStoreItem,
minified?: boolean,
) {
const diagnosticsChecks = store.get().diagnosticsChecks;
const other = diagnosticsChecks.filter((item) => item.code !== check.code);
const smallCheck: IDiagnosticsChecksStoreItem = {
...check,
items: check.items.filter((item) => item.state !== 'success'),
};
const targetCheck = minified ? smallCheck : check;
store.set({
diagnosticsChecks: [...other, check],
diagnosticsChecks: [...other, targetCheck],
});
}

View File

@@ -2610,11 +2610,16 @@ function renderCheckSection(props) {
}
// src/podkop/tabs/diagnostic/updateDiagnosticsCheck.ts
function updateDiagnosticsCheck(check) {
function updateDiagnosticsCheck(check, minified) {
const diagnosticsChecks = store.get().diagnosticsChecks;
const other = diagnosticsChecks.filter((item) => item.code !== check.code);
const smallCheck = {
...check,
items: check.items.filter((item) => item.state !== "success")
};
const targetCheck = minified ? smallCheck : check;
store.set({
diagnosticsChecks: [...other, check]
diagnosticsChecks: [...other, targetCheck]
});
}