diff --git a/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/archive-project-button.tsx b/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/archive-project-button.tsx
index e2957a6733..b24c5f69c4 100644
--- a/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/archive-project-button.tsx
+++ b/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/archive-project-button.tsx
@@ -35,7 +35,12 @@ function ArchiveProjectButton({
const handleArchiveProject = useCallback(async () => {
await archiveProject(project.id)
- updateProjectViewData({ ...project, archived: true, selected: false })
+ updateProjectViewData({
+ ...project,
+ archived: true,
+ selected: false,
+ trashed: false,
+ })
}, [project, updateProjectViewData])
if (project.archived) return null
diff --git a/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/archive-projects-button.tsx b/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/archive-projects-button.tsx
index c033a96bf3..c263eaea39 100644
--- a/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/archive-projects-button.tsx
+++ b/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/archive-projects-button.tsx
@@ -28,7 +28,12 @@ function ArchiveProjectsButton() {
const handleArchiveProjects = useCallback(async () => {
for (const project of selectedProjects) {
await archiveProject(project.id)
- updateProjectViewData({ ...project, archived: true, selected: false })
+ updateProjectViewData({
+ ...project,
+ archived: true,
+ selected: false,
+ trashed: false,
+ })
}
}, [selectedProjects, updateProjectViewData])
diff --git a/services/web/test/frontend/features/project-list/components/project-list-root.test.tsx b/services/web/test/frontend/features/project-list/components/project-list-root.test.tsx
index a9ca3c2742..09229664cc 100644
--- a/services/web/test/frontend/features/project-list/components/project-list-root.test.tsx
+++ b/services/web/test/frontend/features/project-list/components/project-list-root.test.tsx
@@ -223,6 +223,25 @@ describe('', function () {
expect(screen.queryByText('No projects')).to.be.null
})
+
+ it('removes project from view when archiving', async function () {
+ fetchMock.post(`express:/project/:id/archive`, {
+ status: 200,
+ })
+
+ const untrashButton =
+ within(actionsToolbar).getByLabelText('Archive')
+ fireEvent.click(untrashButton)
+
+ const confirmButton = screen.getByText('Confirm')
+ fireEvent.click(confirmButton)
+ expect(confirmButton.disabled).to.be.true
+
+ await fetchMock.flush(true)
+ expect(fetchMock.done()).to.be.true
+
+ screen.getByText('No projects')
+ })
})
})