prefill price from uri

only working for edit button

revert last commit
This commit is contained in:
btzr-io 2017-09-22 17:02:23 -06:00 committed by Jeremy Kauffman
parent f7aec65912
commit 6d38c0e322
2 changed files with 6 additions and 3 deletions

View file

@ -20,6 +20,7 @@ class PublishForm extends React.PureComponent {
this.state = {
id: null,
uri: null,
rawName: "",
name: "",
bid: 10,
@ -166,7 +167,6 @@ class PublishForm extends React.PureComponent {
claim() {
const { claimsByUri } = this.props;
const { uri } = this.state;
return claimsByUri[uri];
}
@ -285,6 +285,7 @@ class PublishForm extends React.PureComponent {
let newState = {
id: claim_id,
uri: "",
channel: channel_name || "anonymous",
bid: amount,
meta_title: title,
@ -437,9 +438,10 @@ class PublishForm extends React.PureComponent {
}
onFileChange() {
const { mode } = this.state;
if (this.refs.file.getValue()) {
this.setState({ hasFile: true });
if (!this.state.customUrl) {
if (!this.state.customUrl && mode !== "edit") {
let fileName = this._getFileName(this.refs.file.getValue());
this.nameChanged(fileName);
}

View file

@ -9,6 +9,7 @@ import {
selectClaimsByUri,
} from "selectors/claims";
import { selectResolvingUris } from "selectors/content";
import { makeSelectCostInfoForUri } from "selectors/cost_info";
import {
doFetchClaimListMine,
doFetchChannelListMine,
@ -20,7 +21,7 @@ import { selectBalance } from "selectors/wallet";
import rewards from "rewards";
import PublishPage from "./view";
const select = state => ({
const select = (state, props) => ({
balance: selectBalance(state),
myClaims: selectMyClaims(state),
fetchingChannels: selectFetchingMyChannels(state),