feat: reactive after save when profile content changes

This commit is contained in:
dongchengjie
2024-06-29 09:21:50 +08:00
parent 6ee5e560cc
commit 80d3c9e96f
12 changed files with 157 additions and 71 deletions

View File

@@ -249,10 +249,10 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
property={value.pac_content ?? ""}
open={editorOpen}
language="javascript"
onChange={(content) => {
onChange={(_prev, curr) => {
let pac = DEFAULT_PAC;
if (content && content.trim().length > 0) {
pac = content;
if (curr && curr.trim().length > 0) {
pac = curr;
}
setValue((v) => ({ ...v, pac_content: pac }));
}}

View File

@@ -129,8 +129,8 @@ export const ThemeViewer = forwardRef<DialogRef>((props, ref) => {
property={theme.css_injection ?? ""}
open={editorOpen}
language="css"
onChange={(content) => {
theme.css_injection = content;
onChange={(_prev, curr) => {
theme.css_injection = curr;
handleChange("css_injection");
}}
onClose={() => {