@@ -83,11 +83,15 @@ export default function AgoraHost() {
8383
8484 const handleBlurBackground = useCallback(() => {
8585 const enableBlur = async () => {
86- virtualBackgroundRef.current?.setOptions({
87- type: "blur",
88- blurDegree: 2,
89- });
90- virtualBackgroundRef.current?.enable();
86+ if (virtualBackgroundRef.current?.enabled) {
87+ virtualBackgroundRef.current?.disable();
88+ } else {
89+ virtualBackgroundRef.current?.setOptions({
90+ type: "blur",
91+ blurDegree: 2,
92+ });
93+ virtualBackgroundRef.current?.enable();
94+ }
9195 };
9296 void enableBlur();
9397 }, [virtualBackgroundRef]);
@@ -203,10 +207,10 @@ export default function AgoraHost() {
203207
204208 <div>
205209 <h4 className="font-bold pb-4">Blur your background?</h4>
206- <div className="flex flex-row justify-center">
210+ <div className="flex flex-row justify-start">
207211 <button onClick={handleBlurBackground}>
208212 <SecondaryButton>
209- <p className="px-4 py-2">Yes</p>
213+ <p className="px-4 py-2">Toggle</p>
210214 </SecondaryButton>
211215 </button>
212216 </div>