Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fix exception with appearance reset. Closes #2459

Gabe Kangaseeff34a4560e
diff --git a/web/pages/admin/config/appearance/index.tsx b/web/pages/admin/config/appearance/index.tsx
index 3fe8556d70..84e2df234a 100644
--- a/web/pages/admin/config/appearance/index.tsx
+++ b/web/pages/admin/config/appearance/index.tsx
@@ -107,7 +107,7 @@ export default function Appearance() {
clearTimeout(resetTimer);
};
- useEffect(() => {
+ const setColorDefaults = () => {
const c = {};
[...paletteVariables, ...componentColorVariables, ...chatColorVariables].forEach(color => {
const resolvedColor = getComputedStyle(document.documentElement).getPropertyValue(
@@ -116,6 +116,10 @@ export default function Appearance() {
c[color.name] = { value: resolvedColor.trim(), description: color.description };
});
setColors(c);
+ };
+
+ useEffect(() => {
+ setColorDefaults();
}, []);
useEffect(() => {
@@ -136,13 +140,13 @@ export default function Appearance() {
};
const reset = async () => {
- setColors({});
await postConfigUpdateToAPI({
apiPath: ENDPOINT,
data: { value: {} },
onSuccess: () => {
setSubmitStatus(createInputStatus(STATUS_SUCCESS, 'Updated.'));
resetTimer = setTimeout(resetStates, RESET_TIMEOUT);
+ setColorDefaults();
},
onError: (message: string) => {
setSubmitStatus(createInputStatus(STATUS_ERROR, message));