From 5d0bddca6b4147de3cb4ab5393f8af39947eec41 Mon Sep 17 00:00:00 2001 From: Dmitry Malkov Date: Mon, 6 Feb 2023 22:54:39 -0600 Subject: [PATCH] Fix Light/Dark theme switch (#165) --- yewprint-doc/src/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yewprint-doc/src/app.rs b/yewprint-doc/src/app.rs index 336d79e..4aa3852 100644 --- a/yewprint-doc/src/app.rs +++ b/yewprint-doc/src/app.rs @@ -55,7 +55,7 @@ impl Component for App { fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { match msg { Msg::ToggleLight => { - DARK.with(|x| x.replace(!*x.borrow())); + DARK.with(|x| x.replace_with(|&mut x| !x)); } Msg::GoToMenu(event, doc_menu) => { event.prevent_default();