<commit_before>import React from "react";
import lbryuri from "lbryuri";
import { BusyMessage } from "component/common";
import ChannelPage from "page/channel";
import FilePage from "page/filePage";

class ShowPage extends React.PureComponent {
  componentWillMount() {
    this.resolve(this.props);
  }

  componentWillReceiveProps(nextProps) {
    this.resolve(nextProps);
  }

  resolve(props) {
    const { isResolvingUri, resolveUri, claim, uri } = props;

    if (!isResolvingUri && claim === undefined && uri) {
      resolveUri(uri);
    }
  }

  render() {
    const { claim, uri, isResolvingUri } = this.props;

    let innerContent = "";

    if (isResolvingUri || !claim) {
      innerContent = (
        <section className="card">
          <div className="card__inner">
            <div className="card__title-identity"><h1>{uri}</h1></div>
          </div>
          <div className="card__content">
            {isResolvingUri &&
              <BusyMessage
                message={__("Loading magic decentralized data...")}
              />}
            {claim === null &&
              <span className="empty">
                {__("There's nothing at this location.")}
              </span>}
          </div>
        </section>
      );
    } else if (claim.name.length && claim.name[0] === "@") {
      innerContent = <ChannelPage uri={uri} />;
    } else if (claim) {
      innerContent = <FilePage uri={uri} />;
    }

    return <main className="main--single-column">{innerContent}</main>;
  }
}

export default ShowPage;<commit_msg>Refresh claim data when show page is mounted<commit_after>import React from "react";
import lbryuri from "lbryuri";
import { BusyMessage } from "component/common";
import ChannelPage from "page/channel";
import FilePage from "page/filePage";

class ShowPage extends React.PureComponent {
  componentWillMount() {
    const { isResolvingUri, resolveUri, uri } = this.props;

    if (!isResolvingUri) resolveUri(uri);
  }

  componentWillReceiveProps(nextProps) {
    const { isResolvingUri, resolveUri, claim, uri } = this.props;

    if (!isResolvingUri && claim === undefined && uri) {
      resolveUri(uri);
    }
  }

  render() {
    const { claim, uri, isResolvingUri } = this.props;

    let innerContent = "";

    if (isResolvingUri && !claim) {
      innerContent = (
        <section className="card">
          <div className="card__inner">
            <div className="card__title-identity"><h1>{uri}</h1></div>
          </div>
          <div className="card__content">
            {isResolvingUri &&
              <BusyMessage
                message={__("Loading magic decentralized data...")}
              />}
            {claim === null &&
              <span className="empty">
                {__("There's nothing at this location.")}
              </span>}
          </div>
        </section>
      );
    } else if (claim && claim.name.length && claim.name[0] === "@") {
      innerContent = <ChannelPage uri={uri} />;
    } else if (claim) {
      innerContent = <FilePage uri={uri} />;
    }

    return <main className="main--single-column">{innerContent}</main>;
  }
}

export default ShowPage;
{'fraction_non_alphanumeric': 0.14402773400567287, 'fraction_numerical': 0.0018909549322407816, 'mean_word_length': 2.438786565547129, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '789767', 'n_tokens_mistral': 928, 'n_tokens_neox': 900, 'n_words': 210}