-
Notifications
You must be signed in to change notification settings - Fork 3
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
implement usePlebbitRpcSettings #335
Comments
you shouldnt hardcode challenge options like
the challenge options should be dynamically provided by challenge.optionInputs. Is that value not there? same with challenge description, this should not be hardcoded, it should be provided by challenge.description
|
fixed ad7a893 |
seems like the challenge names are still hard coded?
everything should come from the plebbit-rpc, nothing should be hard coded, because the rpc will not necessarily have these challenge names, it might have more or less. even the default recommended challenge should probably not be hard coded, because the rpc will not necessarily support a challenge named 'captcha-canvas-v3'. can you make the UI work without a default recommended challenge? I think it's fine to have a default challenge called 'captcha-canvas-v3' as long as the UI still works if the RPC doesn't offer this challenge, but it wont always offer it. if you want to have a default challenge fallback, you could use something like:
this will use the first challenge name in the challenges object, it is possible for the challenges object to be empty, so for defaultChallengeName to be undefined, something to keep in mind. it would probably mean a buggy RPC, but the UI should still at least somewhat work if this happens. |
also you shouldnt hardcode the default challenge options like https://github.com/plebbit/seedit/blob/ad7a8936cb158a934b53e012bc7741641edcdf0b/src/views/subplebbit/subplebbit-settings/subplebbit-settings.tsx#L929C1-L935C11 it's possible that the rpc has a challenge called 'captcha-canvas-v3' but with different options. if you want to use default challenge options you can use the default values provided by you really can't hardcode anything, the challenges provided by the plebbit rpc settings are completely arbitrary, they have to respect the type/schema, but nothing else, there could a challenge called 'captcha-canvas-v3' that doesn't do captchas at all and has different options. it's up to the plebbit rpc to give a list of challenges with options they support. |
in the subplebbit settings/create page, usePlebbitRpcSettings should be used to display the challenges in the challenges setting, instead of hardcoding the challenges. When creating a new sub, the default challenge should be displayed as set automatically.
The text was updated successfully, but these errors were encountered: