From 80e1965e46a64d1c71272af5adf86bc30764ffcd Mon Sep 17 00:00:00 2001 From: btzr-io Date: Thu, 30 Jul 2020 14:31:55 -0500 Subject: [PATCH] prevent name change while editing and more fixes --- ui/component/postEditor/view.jsx | 4 ++-- ui/component/publishForm/view.jsx | 9 ++------- ui/component/publishName/name-help-text.jsx | 2 +- ui/component/publishName/view.jsx | 11 ++++++++++- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ui/component/postEditor/view.jsx b/ui/component/postEditor/view.jsx index bfe74543a..1e7520eba 100644 --- a/ui/component/postEditor/view.jsx +++ b/ui/component/postEditor/view.jsx @@ -74,7 +74,7 @@ function PostEditor(props: Props) { updatePublishForm({ fileText: text }); } } catch (error) { - // Handle error.. + console.error(error); } } @@ -100,7 +100,7 @@ function PostEditor(props: Props) { return ( { if (autoSwitchMode && editingURI && myClaimForUri) { @@ -304,7 +300,7 @@ function PublishForm(props: Props) { label={modeName} button="alt" onClick={() => { - changePublishMode(modeName); + setPublishMode(modeName); }} className={classnames('button-toggle', { 'button-toggle--active': mode === modeName })} /> @@ -363,9 +359,8 @@ function PublishForm(props: Props) { } /> - diff --git a/ui/component/publishName/name-help-text.jsx b/ui/component/publishName/name-help-text.jsx index 4a9a2798a..8abf29b14 100644 --- a/ui/component/publishName/name-help-text.jsx +++ b/ui/component/publishName/name-help-text.jsx @@ -17,7 +17,7 @@ function NameHelpText(props: Props) { let nameHelpText; if (isStillEditing) { - nameHelpText = __('You are currently editing this claim. If you change the URL, you will need to reselect a file.'); + nameHelpText = __('You are currently editing this claim.'); } else if (uri && myClaimForUri) { const editUri = buildURI({ streamName: myClaimForUri.name, diff --git a/ui/component/publishName/view.jsx b/ui/component/publishName/view.jsx index 2ab430d20..8d26eb42b 100644 --- a/ui/component/publishName/view.jsx +++ b/ui/component/publishName/view.jsx @@ -13,6 +13,7 @@ type Props = { uri: string, bid: number, balance: number, + disabled: boolean, isStillEditing: boolean, myClaimForUri: ?StreamClaim, isResolvingUri: boolean, @@ -28,6 +29,7 @@ function PublishName(props: Props) { name, channel, uri, + disabled, isStillEditing, myClaimForUri, bid, @@ -105,7 +107,14 @@ function PublishName(props: Props) { !channel || channel === CHANNEL_ANONYMOUS || channel === CHANNEL_NEW ? '' : `${channel}/` }`} - +