From 56e540802bcbd4909273e184363ac667b879556b Mon Sep 17 00:00:00 2001 From: 65-7a Date: Tue, 21 Dec 2021 10:21:22 +1100 Subject: [PATCH] Disable RAM calculation for txt files --- src/ScriptEditor/ui/ScriptEditorRoot.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index a5456c1bb..926c9556e 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -217,6 +217,10 @@ export function Root(props: IProps): React.ReactElement { ); async function updateRAM(newCode: string): Promise { + if (currentScript != null && currentScript.fileName.endsWith(".txt")) { + debouncedSetRAM(""); + return; + } setUpdatingRam(true); const codeCopy = newCode + ""; const ramUsage = await calculateRamUsage(codeCopy, props.player.getCurrentServer().scripts);