ChemPal Documentation - v1.6.0
    Preparing search index...

    Function putExcludedProducts

    • Write the full excluded-products map back into IndexedDB, overwriting the previous value. Callers typically read via getExcludedProducts, mutate the returned object, and pass it back here — the object store holds one row keyed by "current" so each call is a complete replacement.

      Parameters

      Returns Promise<void>

      Resolves once the write completes; errors are logged, not thrown.

      const map = await getExcludedProducts();
      map["a1b2c3…"] = { url, supplier: "Loudwolf", title, excludedAt: Date.now() };
      await putExcludedProducts(map);
      export async function putExcludedProducts(map: ExcludedProductsMap): Promise<void> {
      try {
      const db = await getDB();
      await db.put(IDB_STORE.EXCLUDED_PRODUCTS, { id: 'current', map });
      } catch (error) {
      logger.error('Failed to put excluded products in IndexedDB', { error });
      }
      }