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

    Function ensureInstallDate

    • Records the install date the first time it's seen. New installs get an exact date from the service worker; pre-existing users are backfilled with "now" on their first open after this ships. A no-op once installedAt is set.

      Returns Promise<void>

      Resolves once the date has been backfilled (or was already present).

      await ensureInstallDate(); // sets installedAt on a profile that had none
      
      export async function ensureInstallDate(): Promise<void> {
      const state = await getReviewPromptState();
      if (state.installedAt > 0) return;
      await cstorage.local.set({
      [CACHE.REVIEW_PROMPT]: { ...state, installedAt: Date.now() },
      });
      }