checks if permlink already exists #221

Merged
merged 1 commit into from Jan 6, 2017

Projects

None yet

3 participants

@nil1511
Collaborator
nil1511 commented Jan 6, 2017

Close #219

@adcpm adcpm temporarily deployed to busy6-pr-221 Jan 6, 2017 Inactive
@nil1511 nil1511 self-assigned this Jan 6, 2017
@adcpm
Owner
adcpm commented Jan 6, 2017

@nil1511 can you add the random string on the end of title like @siol/hey-yo-1b5p3a99l?

@nil1511
Collaborator
nil1511 commented Jan 6, 2017

steemit adds it on beginning. it would be better if we follow same pattern.

@adcpm
Owner
adcpm commented Jan 6, 2017

IMO its better to have a readable string nearly on the url, it's also more common.

@adcpm
Owner
adcpm commented Jan 6, 2017

Any through on this @roadscape?

@adcpm
Owner
adcpm commented Jan 6, 2017 edited

On Steemit random string prefix is used for duplicate title while suffix is used for comment. That make url of comment having both prefix and suffix with random string see https://steemit.com/test/@siol/re-siol-u9soq-hey-yo-20170106t054151946z while it could be https://steemit.com/test/@siol/re-siol-hey-yo-u9soq-20170106t054151946z

@@ -19,23 +20,36 @@ export const CREATE_POST_ERROR = '@editor/CREATE_POST_ERROR';
const requiredFields = 'parentAuthor,parentPermlink,author,permlink,title,body,jsonMetadata'.split(',');
+const getPermlink = (author, permlink) =>
@p0o
p0o Jan 6, 2017 Collaborator

Did you get the algorithm from steemit.com rep? If not please do so and if you did add a comment to the link of the source code you borrow the algorithm from so we can have it for future reference (if they changed it etc)

Also, since it's common better to add it to src/helpers/steemitHelpers.js like the way I did with commentPermlink.

+ SteemConnect
+ .commentAsync(parentAuthor, parentPermlink, author, permlink, title, body, jsonMetadata)
+ .then(({ result }) => {
+ browserHistory.push(`/${parentPermlink}/@${author}/${permlink}`);
@p0o
p0o Jan 6, 2017 Collaborator

It's an anti-pattern to manipulate the UI from an action. The action is supposed to changed the state and UI components should respond to state change.

@adcpm adcpm merged commit 54a60a5 into dev Jan 6, 2017
@nil1511 nil1511 deleted the fix-219 branch Jan 6, 2017
@nil1511 nil1511 restored the fix-219 branch Jan 6, 2017
@nil1511 nil1511 deleted the fix-219 branch Jan 6, 2017
@nil1511
Collaborator
nil1511 commented Jan 6, 2017

This was merged by mistake and was reverted in 18f5c9e

@nil1511 nil1511 removed the waiting-review label Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment