fix: ci and bug in setter
This commit is contained in:
1 parent
52d00eac0f
commit
4aadec1e30
3 files changed
+6
-17
No files matched your search
+1
-14
@@ -9,20 +9,7 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
dioxus::desktop::launch_cfg(app, |c| {
|
dioxus::desktop::launch(app);
|
||||||
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
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn app(cx: Scope) -> Element {
|
pub fn app(cx: Scope) -> Element {
|
||||||
|
|||||||
@@ -690,8 +690,6 @@ impl ScopeState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Pushes the future onto the poll queue to be polled after the component renders.
|
/// 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<Output = ()> + 'static) -> TaskId {
|
pub fn push_future(&self, fut: impl Future<Output = ()> + 'static) -> TaskId {
|
||||||
// wake up the scheduler if it is sleeping
|
// wake up the scheduler if it is sleeping
|
||||||
self.tasks
|
self.tasks
|
||||||
|
|||||||
@@ -59,7 +59,11 @@ impl<'a, T: 'static> UseState<'a, T> {
|
|||||||
|
|
||||||
pub fn setter(&self) -> Rc<dyn Fn(T)> {
|
pub fn setter(&self) -> Rc<dyn Fn(T)> {
|
||||||
let slot = self.0.wip.clone();
|
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)) {
|
pub fn wtih(&self, f: impl FnOnce(&mut T)) {
|
||||||
|
|||||||
Reference in new issue
Block a user