ChemPal Documentation - v1.6.0
    Preparing search index...
    • Announces what changed after the extension updated itself.

      Mirrors UpdatePrompt — same snackbar, same modal — but for a release that is already installed, so there's nothing to apply: the modal ends in a single acknowledging button rather than a call to action, and either control settles it. The notes ship inside the build (__CHANGELOG_CURRENT__), so this works offline and shows exactly what was published for the release.

      Parameters

      Returns null | Element

      The rendered post-update prompt, or nothing when there's nothing to announce.

      const { notice, acknowledge } = useJustUpdated();
      <WhatsNewPrompt notice={notice} onAcknowledge={acknowledge} />
      export function WhatsNewPrompt({ notice, onAcknowledge }: WhatsNewPromptProps) {
      const [notesOpen, setNotesOpen] = useState(false);

      if (!notice) return null;

      return (
      <>
      <PromptSnackbar
      testId="whats-new-snackbar"
      actionTestId="whats-new-snackbar-apply"
      dismissTestId="whats-new-snackbar-dismiss"
      // Steps aside for the modal, exactly as the update prompt does.
      open={!notesOpen}
      message={i18n('update_installed_message', [notice.version])}
      actionLabel={i18n('update_whats_new')}
      onAction={() => setNotesOpen(true)}
      onDismiss={onAcknowledge}
      dismissLabel={i18n('update_dismiss')}
      />
      <WhatsNewModal
      notice={notice}
      open={notesOpen}
      onClose={() => {
      setNotesOpen(false);
      onAcknowledge();
      }}
      />
      </>
      );
      }