|
5 | 5 |
|
6 | 6 | import { Card, InputNumber } from "antd"; |
7 | 7 | import { Map } from "immutable"; |
8 | | - |
9 | 8 | import { Checkbox, Panel } from "@cocalc/frontend/antd-bootstrap"; |
10 | 9 | import { Rendered, redux, useTypedRedux } from "@cocalc/frontend/app-framework"; |
11 | 10 | import { |
@@ -35,6 +34,19 @@ import Tours from "./tours"; |
35 | 34 | import { useLanguageModelSetting } from "./useLanguageModelSetting"; |
36 | 35 | import { UserDefinedLLMComponent } from "./user-defined-llm"; |
37 | 36 |
|
| 37 | +// See https://github.com/sagemathinc/cocalc/issues/5620 |
| 38 | +// There are weird bugs with relying only on mathjax, whereas our |
| 39 | +// implementation of katex with a fallback to mathjax works very well. |
| 40 | +// This makes it so katex can't be disabled. |
| 41 | +const ALLOW_DISABLE_KATEX = false; |
| 42 | + |
| 43 | +export function katexIsEnabled() { |
| 44 | + if (!ALLOW_DISABLE_KATEX) { |
| 45 | + return true; |
| 46 | + } |
| 47 | + return redux.getStore("account")?.getIn(["other_settings", "katex"]) ?? true; |
| 48 | +} |
| 49 | + |
38 | 50 | interface Props { |
39 | 51 | other_settings: Map<string, any>; |
40 | 52 | is_stripe_customer: boolean; |
@@ -110,7 +122,10 @@ export function OtherSettings(props: Readonly<Props>): JSX.Element { |
110 | 122 | } |
111 | 123 | } |
112 | 124 |
|
113 | | - function render_katex(): Rendered { |
| 125 | + function render_katex() { |
| 126 | + if (!ALLOW_DISABLE_KATEX) { |
| 127 | + return null; |
| 128 | + } |
114 | 129 | return ( |
115 | 130 | <Checkbox |
116 | 131 | checked={!!props.other_settings.get("katex")} |
|
0 commit comments