From 51064d95e04fe93b255159bdaf3f7be84911030b Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 2 Feb 2024 14:13:47 +0100 Subject: [PATCH] fix: only register workspace once Fixes #5332. Looks like #4698 brought back the file list header initialization that had just been moved to an init script in #4776. Signed-off-by: Max --- cypress/e2e/workspace.spec.js | 9 +++++++++ src/files.js | 6 ------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/workspace.spec.js b/cypress/e2e/workspace.spec.js index 1a2fa8add60..3e94970e069 100644 --- a/cypress/e2e/workspace.spec.js +++ b/cypress/e2e/workspace.spec.js @@ -38,6 +38,15 @@ describe('Workspace', function() { cy.createTestFolder().as('testFolder') }) + it('Initializes the workspace without errors', function() { + cy.visitTestFolder({ + onBeforeLoad: win => cy.spy(win.console, 'error').as('consoleError'), + }) + cy.then(() => { + expect(this.consoleError).to.not.have.been.calledWithMatch('workspace') + }) + }) + it('Hides the workspace when switching to another folder', function() { cy.uploadFile('test.md', 'text/markdown', `${this.testFolder}/README.md`) cy.createFolder(`${this.testFolder}/subdirectory`) diff --git a/src/files.js b/src/files.js index 94c2d9d05d8..67cadf325ab 100644 --- a/src/files.js +++ b/src/files.js @@ -21,7 +21,6 @@ */ import { linkTo } from '@nextcloud/router' import { loadState } from '@nextcloud/initial-state' -import { registerFileListHeaders } from '@nextcloud/files' import { logger } from './helpers/logger.js' @@ -55,11 +54,6 @@ document.addEventListener('DOMContentLoaded', async () => { el: () => { return el }, })) } - - if (workspaceAvailable) { - const { FilesWorkspaceHeader } = await import('./helpers/files.js') - registerFileListHeaders(FilesWorkspaceHeader) - } }) OCA.Text = {