Skip to content

Conversation

PlayerIUnknown
Copy link

This Pull Request addresses issue #10 where the extension was allowing submission even when no data sources were selected. This behavior led to unnecessary API calls and an indefinite loading state, negatively impacting the user experience and potentially causing unauthorized requests, as observed with the GitHub API mentioned in issue #10 .

Key Changes:

  1. Submit Button State Management:

    • The "Submit" button is now conditionally enabled based on whether at least one data source checkbox is checked. This prevents the user from submitting the form without selecting any data sources, which aligns with the expected behavior of the application.
  2. User Feedback:

    • A notification is triggered when the "Submit" button is disabled due to no data sources being selected. This provides clear feedback to the user, helping to correct their actions without confusion.
  3. Code Enhancements:

    • Added updateSubmitButtonState function to check the state of data source selections and update the button's enabled state accordingly.
    • Integrated this check into the checkbox initialization and change events, ensuring that the button's state is always in sync with the form selections.

Benefits:

  • Prevents Unnecessary API Calls: Ensures that API requests are only made when valid data sources are selected, conserving resources and adhering to API usage policies.
  • Improves User Experience: Provides immediate feedback to users, helping them understand the need to select at least one data source before proceeding.

Steps to Test:

  1. Navigate to the settings page of the VulnTotal Browser Extension.
  2. Attempt to deselect all data sources and submit the form.
  3. Observe that the "Submit" button is disabled, and a notification prompts the selection of at least one data source.
  4. Select one or more data sources and verify that the "Submit" button becomes enabled.

Before:

Screenshot 2024-12-17 024442

After:

Screenshot 2024-12-18 040537

…ension repo.

Signed-off-by: PlayerIUnknown <playerunknownasap@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant