diff --git a/assets/src/bundles/add_forge/create-request.js b/assets/src/bundles/add_forge/create-request.js --- a/assets/src/bundles/add_forge/create-request.js +++ b/assets/src/bundles/add_forge/create-request.js @@ -89,7 +89,10 @@ ajax: { 'url': Urls.add_forge_request_list_datatables(), data: (d) => { - if (swh.webapp.isUserLoggedIn() && $(`#${addForgeCheckboxId}`).prop('checked')) { + const checked = $(`#${addForgeCheckboxId}`).prop('checked'); + // If this function is called while the page is loading, 'checked' is + // undefined. As the checkbox defaults to being checked, coerce this to true. + if (swh.webapp.isUserLoggedIn() && (checked === undefined || checked)) { d.user_requests_only = '1'; } } diff --git a/cypress/integration/add-forge-now-request-create.spec.js b/cypress/integration/add-forge-now-request-create.spec.js --- a/cypress/integration/add-forge-now-request-create.spec.js +++ b/cypress/integration/add-forge-now-request-create.spec.js @@ -71,10 +71,6 @@ cy.get('#swh-add-forge-requests-list-tab').click(); cy.get('#swh-add-forge-user-filter').should('exist').should('be.checked'); - // Uncheck and re-check again, to synchronize table state with the checkbox - // FIXME: this should not be needed - cy.get('#swh-add-forge-user-filter').click().click(); - // check unfiltered user requests cy.get('tbody tr').then(rows => { expect(rows.length).to.eq(2);