Skip to content

Commit 42732a9

Browse files
fix: disable changing editor theme when system is selected
1 parent a075ef5 commit 42732a9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/pages/themeSetting/themeSetting.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import CustomTheme from "pages/customTheme";
1010
import ThemeBuilder from "theme/builder";
1111
import themes from "theme/list";
1212
import helpers from "utils/helpers";
13+
import alert from "dialogs/alert";
1314

1415
export default function () {
1516
const $page = Page(strings.theme.capitalize());
1617
const $search = <span attr-action="search" className="icon search"></span>;
1718
const $themePreview = <div id="theme-preview"></div>;
18-
const list = Ref();
19+
const list = new Ref();
1920
const editor = ace.edit($themePreview);
2021

2122
const session = ace.createEditSession("");
@@ -194,9 +195,9 @@ console.log(message);`);
194195
*/
195196
function setEditorTheme({ caption, theme }) {
196197
if (appSettings.value.appTheme.toLowerCase() === "system") {
197-
alert(
198-
"App theme is set to 'System'. Changing the editor theme will not affect the editor appearance.",
198+
alert("Info", "App theme is set to 'System'. Changing the editor theme will not affect the editor appearance.",
199199
);
200+
return;
200201
}
201202
editorManager.editor.setTheme(theme);
202203
editor.setTheme(theme); // preview

0 commit comments

Comments
 (0)