Fix sharelink#630
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a -crowdsec command-line flag to the installer to toggle the CrowdSec installation prompt and updates the dev:setup script in package.json to use generic database commands. A critical issue was identified in CreateShareLinkForm.tsx where the logic for the 'Create Link' button's disabled state was incorrectly inverted, which would prevent users from initiating link creation.
| onClick={form.handleSubmit(onSubmit)} | ||
| loading={loading} | ||
| disabled={link !== null || loading} | ||
| disabled={link === null || loading} |
There was a problem hiding this comment.
The logic for the disabled prop on the "Create Link" button is inverted. By changing the condition to link === null, the button will be disabled by default when the form is first opened (since link is initialized to null at line 82), preventing users from ever creating a link. The original logic link !== null was correct as it ensures the button is enabled for the initial creation and disabled once a link has already been generated or while the request is loading.
| disabled={link === null || loading} | |
| disabled={link !== null || loading} |
|
Warning This image may contain unchecked and breaking changes. Only use on own risk. 👋 Thanks for your PR! SQLITE Image: Postgresql Image: |
|
Warning This image may contain unchecked and breaking changes. Only use on own risk. 👋 Thanks for your PR! SQLITE Image: Postgresql Image: |
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
How to test?