From 4aadec1e30e5e4aa86bdfa56d8fbff9dc7fa1c69 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 5 Jan 2022 22:15:19 -0500 Subject: [PATCH] fix: ci and bug in setter --- examples/tailwind.rs | 15 +-------------- packages/core/src/scopes.rs | 2 -- packages/hooks/src/usestate/handle.rs | 6 +++++- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/examples/tailwind.rs b/examples/tailwind.rs index 1115d09b9..cbefd248f 100644 --- a/examples/tailwind.rs +++ b/examples/tailwind.rs @@ -9,20 +9,7 @@ use dioxus::prelude::*; fn main() { - dioxus::desktop::launch_cfg(app, |c| { - if cfg!(target_os = "macos") { - // we can configure our primary window through the Tauri Config - use dioxus::desktop::tao::platform::macos::*; - c.with_window(|w| { - w.with_fullsize_content_view(true) - .with_titlebar_buttons_hidden(false) - .with_titlebar_transparent(true) - .with_movable_by_window_background(true) - }) - } else { - c - } - }); + dioxus::desktop::launch(app); } pub fn app(cx: Scope) -> Element { diff --git a/packages/core/src/scopes.rs b/packages/core/src/scopes.rs index 66d6cdff5..1ed715208 100644 --- a/packages/core/src/scopes.rs +++ b/packages/core/src/scopes.rs @@ -690,8 +690,6 @@ impl ScopeState { } /// Pushes the future onto the poll queue to be polled after the component renders. - /// - /// The future is forcibly dropped if the component is not ready by the next render pub fn push_future(&self, fut: impl Future + 'static) -> TaskId { // wake up the scheduler if it is sleeping self.tasks diff --git a/packages/hooks/src/usestate/handle.rs b/packages/hooks/src/usestate/handle.rs index b9751044a..2638feaa8 100644 --- a/packages/hooks/src/usestate/handle.rs +++ b/packages/hooks/src/usestate/handle.rs @@ -59,7 +59,11 @@ impl<'a, T: 'static> UseState<'a, T> { pub fn setter(&self) -> Rc { let slot = self.0.wip.clone(); - Rc::new(move |new| *slot.borrow_mut() = Some(new)) + let callback = self.0.update_callback.clone(); + Rc::new(move |new| { + callback(); + *slot.borrow_mut() = Some(new) + }) } pub fn wtih(&self, f: impl FnOnce(&mut T)) {