Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to abandon publishing in usePublishComment #2

Open
estebanabaroa opened this issue Apr 28, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@estebanabaroa
Copy link
Member

estebanabaroa commented Apr 28, 2023

The current API for publishing is:

const {publishComment, challenge, challengeVerification} = usePublishComment(options)

If the user closes the challenge modal, there are no ways to communicate to the hooks that the user abandoned publishing, and mark the pending account comment as failed immediately, with an appropriate comment.reason.

a function like abandon or stop should be added. if the user closes the modal, it can be called, and the account comment can be changed to failed and a comment.reason can be added.

it might be annoying for the user to display all the failed comments in the UI, so a hook to delete the account comments could be added, and the user could click "X" to delete the failed comment using the hook.

@estebanabaroa
Copy link
Member Author

estebanabaroa commented Jan 9, 2024

I thought of an easy way to implement deleting a pending/failed comment. there could be a hook called deleteComment() and it would mark the comment as accountComment.accountDeleted = true

and the frontend could simply hide or filter accountComment.accountDeleted: true comments

I dont think we can just remove account comments from the array, it's too complicated of a design. we also cant just call it accountComment.deleted because that's a protocol field, it means the comment was deleted by the author at the protocol/network level, whereas in our case we're just trying to remove a comment from the local db, or hide it from the user's view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant