From df66ef6ed86874cd4e948ac0f0b4fe0d0a6d13e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Gran=C3=A1t?= Date: Thu, 23 Jan 2025 13:16:57 +0100 Subject: [PATCH] fix: resize observer throwing errors into console --- e2e/cypress/e2e/translations/namespaces.cy.ts | 11 ----------- webapp/src/globalContext/useLayoutService.ts | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/e2e/cypress/e2e/translations/namespaces.cy.ts b/e2e/cypress/e2e/translations/namespaces.cy.ts index e34e5b016e..ac27763d19 100644 --- a/e2e/cypress/e2e/translations/namespaces.cy.ts +++ b/e2e/cypress/e2e/translations/namespaces.cy.ts @@ -36,17 +36,6 @@ describe('namespaces in translations', () => { }); it('displays ', () => { - cy.on('uncaught:exception', (err, runnable) => { - // Ignore ResizeObserver - not clear cause, appears only in this test - if ( - err.message.includes( - 'ResizeObserver loop completed with undelivered notifications' - ) - ) { - return false; // Prevent Cypress from failing the test - } - return true; // Allow other errors to fail the test - }); createTranslation({ key: 'new-key', namespace: 'new-ns' }); gcy('translations-namespace-banner') .contains('new-ns') diff --git a/webapp/src/globalContext/useLayoutService.ts b/webapp/src/globalContext/useLayoutService.ts index c23decb63e..9b9aacbecd 100644 --- a/webapp/src/globalContext/useLayoutService.ts +++ b/webapp/src/globalContext/useLayoutService.ts @@ -23,7 +23,7 @@ export const useLayoutService = ({ quickStart }: Props) => { useResizeObserver({ ref: bodyRef, onResize(size) { - setBodyWidth(size.width!); + Promise.resolve(() => setBodyWidth(size.width!)); }, });