Skip to content

Checkboxs on the frontend do not work on Chrome when the UI language is not English #562

@w568w

Description

@w568w

Expected Behavior

When toggling checkboxes on the frontend page, the corresponding settings should be updated accordingly.

Actual Behavior

The local storage is never updated with the new value.

Steps to Reproduce

  1. open the frontend; navigate to Generate tab page.
  2. toggle the checkbox at the top-right popup of the page, such as Auto Clear Batch.
  3. check the local storage by running localStorage.getItem('autoClearBatch'), which always returns the same value.

Debug Logs

N/A; it is a frontend bug.

Other

I believe this stems from the line 51 below:

/** Reference to the auto-clear-batch toggle checkbox. */
let autoClearBatchElem = getRequiredElementById('auto_clear_batch_checkbox');
autoClearBatchElem.checked = localStorage.getItem('autoClearBatch') == 'true';
/** Called when the user changes auto-clear-batch toggle to update local storage. */
function toggleAutoClearBatch() {
localStorage.setItem('autoClearBatch', `${autoClearBatchElem.checked}`);
}

I log autoClearBatchElem.checked within toggleAutoClearBatch(), but it is always true (or false). However, if I replace the cached element with:

function toggleAutoClearBatch() { 
    localStorage.setItem('autoClearBatch', `${getRequiredElementById('auto_clear_batch_checkbox').checked}`); 
} 

It works correctly. So, the issue seems to be related to the cached element autoClearBatchElem? Could it be that these elements are recreated after the page loads, but main.js does not update the variables?


Browser: Brave v1.74.48 Chromium: 132.0.6834.83 64-bit
OS: Windows 11 24H2

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions