Skip to content

Commit afad88b

Browse files
fix: disable changing editor theme when system is selected (Acode-Foundation#1529)
* fix: disable changing editor theme when system is selected * format
1 parent a075ef5 commit afad88b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pages/themeSetting/themeSetting.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import "./themeSetting.scss";
22
import Page from "components/page";
33
import searchBar from "components/searchbar";
44
import TabView from "components/tabView";
5+
import alert from "dialogs/alert";
56
import Ref from "html-tag-js/ref";
67
import actionStack from "lib/actionStack";
78
import removeAds from "lib/removeAds";
@@ -15,7 +16,7 @@ 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("");
@@ -195,8 +196,10 @@ console.log(message);`);
195196
function setEditorTheme({ caption, theme }) {
196197
if (appSettings.value.appTheme.toLowerCase() === "system") {
197198
alert(
199+
"Info",
198200
"App theme is set to 'System'. Changing the editor theme will not affect the editor appearance.",
199201
);
202+
return;
200203
}
201204
editorManager.editor.setTheme(theme);
202205
editor.setTheme(theme); // preview

0 commit comments

Comments
 (0)