Fix Light/Dark theme switch (#165)

This commit is contained in:
Dmitry Malkov 2023-02-06 22:54:39 -06:00 committed by GitHub
parent fa96d3e403
commit 5d0bddca6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,7 @@ impl Component for App {
fn update(&mut self, ctx: &Context<Self>, 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();