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

    Function markDropsSeen

    • Marks products' latest drops as seen, so the badge stops counting them.

      Parameters

      • alerts: readonly PriceAlert[]

        The alerts; those without an unseen drop are left alone

      Returns Promise<void>

      Resolves once they are updated

      await markDropsSeen(alerts);
      
      export async function markDropsSeen(alerts: readonly PriceAlert[]): Promise<void> {
      await Promise.all(
      getUnseenDrops(alerts).map(({ id }) => updatePriceAlert(id, { hasUnseenDrop: false })),
      );
      }