componentDidUpdate()

in src/amo/components/AddonSuggestions/index.js [170:182]


  componentDidUpdate(prevProps: Props) {
    const { addon: oldAddon } = prevProps;
    const { addon: newAddon, i18n } = this.props;

    // Fetch suggestions when the add-on changes.
    if (
      newAddon &&
      getCategory(newAddon, i18n) &&
      (!oldAddon || (oldAddon && oldAddon.guid !== newAddon.guid))
    ) {
      this.dispatchFetchSuggestions(newAddon);
    }
  }