From 8fa13a2645487ce80b1b128e3bf3f2c253072afb Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Fri, 5 Jan 2024 08:42:33 +0000 Subject: [PATCH] HPCC-31072 ECL Watch using deprecated editor method Caused ECL Playground to fail Signed-off-by: Gordon Smith --- esp/src/src-react/components/ECLPlayground.tsx | 8 ++++---- esp/src/src-react/components/SourceEditor.tsx | 4 ++-- esp/src/src/ECLArchiveWidget.ts | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/esp/src/src-react/components/ECLPlayground.tsx b/esp/src/src-react/components/ECLPlayground.tsx index 7c3d436c02c..14ff6d1de1b 100644 --- a/esp/src/src-react/components/ECLPlayground.tsx +++ b/esp/src/src-react/components/ECLPlayground.tsx @@ -376,9 +376,9 @@ export const ECLPlayground: React.FunctionComponent = (props if (editor) { if (theme.semanticColors.link === darkTheme.palette.themePrimary) { - editor.setOption("theme", "darcula"); + editor.option("theme", "darcula"); } else { - editor.setOption("theme", "default"); + editor.option("theme", "default"); } } }, [wuid, editor, theme]); @@ -404,9 +404,9 @@ export const ECLPlayground: React.FunctionComponent = (props const handleThemeToggle = React.useCallback((evt) => { if (!editor) return; if (evt.detail && evt.detail.dark === true) { - editor.setOption("theme", "darcula"); + editor.option("theme", "darcula"); } else { - editor.setOption("theme", "default"); + editor.option("theme", "default"); } }, [editor]); useOnEvent(document, "eclwatch-theme-toggle", handleThemeToggle); diff --git a/esp/src/src-react/components/SourceEditor.tsx b/esp/src/src-react/components/SourceEditor.tsx index e2a4060741d..6a367c39c71 100644 --- a/esp/src/src-react/components/SourceEditor.tsx +++ b/esp/src/src-react/components/SourceEditor.tsx @@ -76,9 +76,9 @@ export const SourceEditor: React.FunctionComponent = ({ const handleThemeToggle = React.useCallback((evt) => { if (!editor) return; if (evt.detail && evt.detail.dark === true) { - editor.setOption("theme", "darcula"); + editor.option("theme", "darcula"); } else { - editor.setOption("theme", "default"); + editor.option("theme", "default"); } }, [editor]); useOnEvent(document, "eclwatch-theme-toggle", handleThemeToggle); diff --git a/esp/src/src/ECLArchiveWidget.ts b/esp/src/src/ECLArchiveWidget.ts index 879efbfa4fd..e1ac7eb193b 100644 --- a/esp/src/src/ECLArchiveWidget.ts +++ b/esp/src/src/ECLArchiveWidget.ts @@ -59,9 +59,9 @@ export class ECLArchiveWidget { setEditorTheme() { if (themeIsDark()) { - this.editor.setOption("theme", "darcula"); + this.editor.option("theme", "darcula"); } else { - this.editor.setOption("theme", "default"); + this.editor.option("theme", "default"); } } @@ -108,9 +108,9 @@ export class ECLArchiveWidget { const handleThemeToggle = (evt) => { if (!context.editor) return; if (evt.detail && evt.detail.dark === true) { - context.editor.setOption("theme", "darcula"); + context.editor.option("theme", "darcula"); } else { - context.editor.setOption("theme", "default"); + context.editor.option("theme", "default"); } }; document.addEventListener("eclwatch-theme-toggle", handleThemeToggle);