исправлен баг в shouldWarnCounterPairs

This commit is contained in:
Grog 2026-10-29 11:19:02 +03:00
parent 0e536b7867
commit 65c44978bd

View File

@ -140,7 +140,7 @@ export const shouldWarnCounterPairs = (
pairs: readonly CounterPairOut[], pairs: readonly CounterPairOut[],
storage: Pick<Storage, 'getItem'> | null, storage: Pick<Storage, 'getItem'> | null,
): boolean => { ): boolean => {
if (pairs.length === 0) return false; if (pairs?.length === 0) return false;
if (status && FINISHED_STATUSES.includes(status)) return false; if (status && FINISHED_STATUSES.includes(status)) return false;
try { try {
return storage?.getItem(`${COUNTER_PAIRS_STORAGE_PREFIX}${versionId}`) !== counterPairsKey(pairs); return storage?.getItem(`${COUNTER_PAIRS_STORAGE_PREFIX}${versionId}`) !== counterPairsKey(pairs);