From a4022284c581eeb7b6740b948f5e915a860fb27f Mon Sep 17 00:00:00 2001
From: sowgro <tpoke.ferrari@gmail.com>
Date: Wed, 6 Nov 2024 20:41:07 -0500
Subject: Fix settings not updating

---
 extension/src/RadioButtonGroup.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'extension/src/RadioButtonGroup.tsx')

diff --git a/extension/src/RadioButtonGroup.tsx b/extension/src/RadioButtonGroup.tsx
index 12276dd..da1b521 100644
--- a/extension/src/RadioButtonGroup.tsx
+++ b/extension/src/RadioButtonGroup.tsx
@@ -2,12 +2,15 @@ import React, {ReactElement, useEffect, useId, useState} from "react";
 
 interface RadioProps {
     children: ReactElement<HTMLOptionElement>[],
-    defaultValue: any,
+    value: any,
     onChange?: (arg0: any) => void
 }
 
 function RadioButtonGroup(props: RadioProps) {
-    const [selected, setSelected] = useState(props.defaultValue);
+    const [selected, setSelected] = useState(props.value);
+    useEffect(() => {
+        setSelected(props.value);
+    }, [props.value]);
     useEffect(() => {
         props.onChange && props.onChange(selected);
     }, [selected])
-- 
cgit v1.2.3

