diff --git a/src/devhub/entity/post/PostEditor.jsx b/src/devhub/entity/post/PostEditor.jsx index 85dd99266..06d539f4e 100644 --- a/src/devhub/entity/post/PostEditor.jsx +++ b/src/devhub/entity/post/PostEditor.jsx @@ -1,3 +1,12 @@ +const cleanDescription = (description) => { + return description + ? description.replace( + /###### Requested amount: .+?\n###### Requested sponsor: @[^\s]+\n/g, + "" + ) + : description; +}; + initState({ seekingFunding: props.seekingFunding ?? false, author_id: context.accountId, @@ -89,13 +98,6 @@ const labels = labelStrings.map((s) => { return { name: s }; }); -const cleanDescription = (description) => { - return description.replace( - /###### Requested amount: .+?\n###### Requested sponsor: @[^\s]+\n/g, - "" - ); -}; - if (!state.draftStateApplied && props.draftState) { State.update({ ...props.draftState, draftStateApplied: true }); }