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

    Function clearPriceHistory

    • Delete all price-history series. Exposed via the "Clear price history" button in the settings panel. Deliberately kept out of clearAllCaches so a routine cache clear never destroys the user's accumulated price history.

      Returns Promise<void>

      Resolves once the store is cleared; errors are logged, not thrown.

      await clearPriceHistory();
      const series = await getPriceSeriesByProduct("3f9c2a…"); // => []
      export async function clearPriceHistory(): Promise<void> {
      try {
      const db = await getDB();
      await db.clear(IDB_STORE.PRICE_HISTORY);
      } catch (error) {
      logger.error('Failed to clear price history from IndexedDB', { error });
      }
      }