From ece440cb28523e1c6a683a557e97d07a7a18fc7a Mon Sep 17 00:00:00 2001 From: 1aerostorm Date: Sat, 11 Nov 2023 13:23:24 +0000 Subject: [PATCH] Fix sponsors --- app/components/modules/PostForm/PostForm.jsx | 18 ++++++++++++------ app/components/modules/SponsorSubscription.jsx | 10 ++++++---- app/components/pages/SubmitPost.jsx | 14 +++++++++++--- app/locales/en.json | 1 + app/locales/ru-RU.json | 1 + 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/app/components/modules/PostForm/PostForm.jsx b/app/components/modules/PostForm/PostForm.jsx index d78c33076..52caddad0 100644 --- a/app/components/modules/PostForm/PostForm.jsx +++ b/app/components/modules/PostForm/PostForm.jsx @@ -657,7 +657,7 @@ class PostForm extends React.Component { data, editMode, visibleType, - () => { + (payload) => { try { if (editMode) { sessionStorage.removeItem(EDIT_KEY); @@ -667,11 +667,15 @@ class PostForm extends React.Component { } catch (err) {} if (!this._unmount) { - this.setState({ - isPosting: false, - }); + setTimeout(() => { + if (!this._unmount) { + this.setState({ + isPosting: false, + }) + } + }, 1000) - this.props.onSuccess(); + this.props.onSuccess(payload, editMode, visibleType) } if (!editMode) { @@ -835,7 +839,9 @@ export default connect( confirm, hideErrors: true, errorCallback: onError, - successCallback: onSuccess, + successCallback: () => { + onSuccess(payload) + }, }) ); }, diff --git a/app/components/modules/SponsorSubscription.jsx b/app/components/modules/SponsorSubscription.jsx index 790ebdf19..22c7f0b14 100644 --- a/app/components/modules/SponsorSubscription.jsx +++ b/app/components/modules/SponsorSubscription.jsx @@ -71,7 +71,7 @@ class SponsorSubscription extends React.Component { const { username } = this.props this.setSubmitting(true) if (values.author) { - await this.props.updatePso(username, values.oid, values.cost, () => { + await this.props.updatePso(username, values.oid, values.cost, values.subscribers, () => { this.setState({ saved: true, }) @@ -175,7 +175,7 @@ class SponsorSubscription extends React.Component { onSubmit={this._onSubmit} > {({ - handleSubmit, isValid, values, setFieldValue, handleChange, + handleSubmit, isValid, values, dirty, setFieldValue, handleChange, }) => { const { symbol } = values.cost.asset return ( @@ -196,7 +196,7 @@ class SponsorSubscription extends React.Component {
{pso.author ?
-