ChemPal Documentation - v0.0.13-beta.5
    Preparing search index...

    Module helpers/excludedProducts

    Functions

    shouldExcludeProduct

    Check whether a given product (identified by URL + supplier name) is on the user's ignore list. Called from the supplier hot-path to drop results the user previously excluded. Returns false on any read error so a storage blip can't accidentally hide everything.

    getProductExclusionKey

    Derive the stable exclusion key for a product. This mirrors the key shape used by SupplierCache.getProductDataCacheKey (see SupplierBase.ts line 1337) so that exclusion checks performed inside the supplier's product detail path can be compared against entries written from the UI context menu without the two sides drifting.

    loadExcludedProducts

    Load the excluded-products map from IndexedDB. Returns an empty object if the store is empty or the read fails, so callers can treat the result as always-valid.

    loadExcludedProductKeys

    Load just the set of exclusion keys — convenient for hot-path membership checks (e.g. inside SupplierBase.getProductData) where the full metadata is not needed.

    countExcludedProductsForSupplier

    Count how many excluded entries were ignored from a given supplier. Used by SupplierBase.execute to over-fetch from queryProducts so that dropping previously-ignored rows still leaves the caller with limit survivors instead of a short list.

    addExcludedProduct

    Add a product to the excluded list in IndexedDB. Idempotent: re-excluding an already-ignored product just refreshes its excludedAt and last-known title. Returns the exclusion key for the caller's logging convenience.

    removeExcludedProduct

    Remove a single entry from the excluded-products map in IndexedDB. Load → delete → put, matching addExcludedProduct's read-modify-write shape so a caller holding a stale map cannot clobber concurrent writes. No-op (and no write) when the key is absent, so repeated removals are safe. Errors are logged, not thrown — callers don't need to try/catch.

    Interfaces

    ExcludedProductEntry

    Minimal metadata stored for each excluded product so the user can review (and eventually un-exclude) their ignore list from settings.

    Type Aliases

    ExcludedProductsMap

    Map of exclusion-key → excluded product entry, as persisted in the excludedProducts IndexedDB object store (via @/utils/idbCache).