mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-12 14:37:03 +03:00
feat: add optional minified check displaying
This commit is contained in:
@@ -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],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user