Skip to content

Commit

Permalink
HPCC-31072 ECL Watch using deprecated editor method
Browse files Browse the repository at this point in the history
Caused ECL Playground to fail

Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Jan 5, 2024
1 parent 1778040 commit 8fa13a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions esp/src/src-react/components/ECLPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ export const ECLPlayground: React.FunctionComponent<ECLPlaygroundProps> = (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]);
Expand All @@ -404,9 +404,9 @@ export const ECLPlayground: React.FunctionComponent<ECLPlaygroundProps> = (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);
Expand Down
4 changes: 2 additions & 2 deletions esp/src/src-react/components/SourceEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ export const SourceEditor: React.FunctionComponent<SourceEditorProps> = ({
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);
Expand Down
8 changes: 4 additions & 4 deletions esp/src/src/ECLArchiveWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8fa13a2

Please sign in to comment.