constructor()

in src/amo/pages/UserProfileEdit/index.js [114:150]


  constructor(props: InternalProps) {
    super(props);

    const { dispatch, errorHandler, userId, user } = props;

    this.state = {
      showProfileDeletionModal: false,
      pictureData: null,
      successMessage: null,
      ...this.getFormValues(user),
    };

    dispatch(setViewContext(VIEW_CONTEXT_HOME));

    if (errorHandler.hasError()) {
      log.warn('Not loading data because of an error.');
      return;
    }

    if (!user && userId) {
      dispatch(
        fetchUserAccount({
          errorHandlerId: errorHandler.id,
          userId,
        }),
      );
    }

    if ((!user && userId) || (user && !user.notifications)) {
      dispatch(
        fetchUserNotifications({
          errorHandlerId: errorHandler.id,
          userId,
        }),
      );
    }
  }