Skip to content

Commit

Permalink
story: Try to fix #104 Linux crash error.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Oct 2, 2024
1 parent 494e6d1 commit ff92b34
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/app/src/story_workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ pub struct StoryWorkspace {

impl StoryWorkspace {
pub fn new(_app_state: Arc<AppState>, cx: &mut ViewContext<Self>) -> Self {
cx.observe_window_appearance(|_workspace, cx| {
Theme::sync_system_appearance(cx);
cx.observe_window_appearance(|_, cx| {
cx.spawn(move |_, mut cx| {
_ = cx.update(|cx| {
println!("sync_system_appearance");
Theme::sync_system_appearance(cx);
});

Task::ready(())
})
.detach();
})
.detach();

Expand Down

0 comments on commit ff92b34

Please sign in to comment.