From 15d89463271b0460c3f8d6b0fc92f930123693f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=B0=D0=B1?= =?UTF-8?q?=D1=83=D1=88=D0=BA=D0=B8=D0=BD?= Date: Mon, 26 May 2025 14:26:19 +0200 Subject: [PATCH] add warning toast --- frontend/app/player/web/managers/WindowNodeCounter.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/app/player/web/managers/WindowNodeCounter.ts b/frontend/app/player/web/managers/WindowNodeCounter.ts index 97791a01a..b8ce196a7 100644 --- a/frontend/app/player/web/managers/WindowNodeCounter.ts +++ b/frontend/app/player/web/managers/WindowNodeCounter.ts @@ -1,3 +1,5 @@ +import { toast } from 'react-toastify'; + class NodeCounter { private parent: NodeCounter | null = null; @@ -15,6 +17,11 @@ class NodeCounter { newChild(): NodeCounter { const child = new NodeCounter(); this.children.push(child); + if (this.children.length === 5000) { + toast.warn('An element with 5,000+ children was found. This can slow down rendering and degrade performance.', { + autoClose: false, + }); + } child.parent = this; this.bubbleCount(1); return child;