Skip to content

[BUG] Global loading state affects both compress and decompress buttons #1

Closed

Description

@subha0319

Description:

Current Behavior:
When an API call is initiated (e.g., clicking "Compress"), a single loading state is activated. This causes both the "Compress" and "Decompress" buttons to enter a disabled, loading state simultaneously (e.g., showing "Compressing..." and "Decompressing..."). The same issue occurs in reverse when clicking the "Decompress" button.

Expected Behavior:

  • When the Compress button is clicked, only the Compress button should show a "Compressing..." state. The Decompress button should be disabled but its text should not change.
  • When the Decompress button is clicked, only the Decompress button should show a "Decompressing..." state. The Compress button should be disabled but its text should not change.

Root Cause:
The application currently uses a single, shared loading state variable in the App.js component to manage the loading status for both compression and decompression API calls.

Suggested Solution:
Refactor the state management to use separate loading state variables for each action. For example, instead of a single loading state, implement two distinct states:

  • isCompressing
  • isDecompressing

Update the button components to conditionally render their text and disabled status based on these more specific states.

Screenshot of the Issue:

Image

Activity

  1. bittu9975 commented on Oct 11, 2025

    @bittu9975
    Contributor

    hi @subha0319 can you please assign this issue to me , i would love to work on it.

  2. subha0319 commented on Oct 11, 2025

    @subha0319
    OwnerAuthor

    Hi @bittu9975 Thanks for your interest in contributing! I've assigned the issue to you.

    Feel free to ask any questions if you run into any trouble.

  3. subha0319 commented on Oct 12, 2025

    @subha0319
    OwnerAuthor

    Thanks @bittu9975 for fixing this issue.
    PR: fix(frontend): Separate loading states for compress/decompress buttons #2 close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions