Skip to content

Commit

Permalink
refactor: single instance subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Mar 2, 2024
1 parent 68cdb39 commit 54ea121
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/app/cosmic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,6 @@ where
})
.map(super::Message::Cosmic),
window_events.map(super::Message::Cosmic),
#[cfg(feature = "single-instance")]
self.app
.core()
.single_instance
.then(|| super::single_instance_subscription::<T>())
.unwrap_or_else(Subscription::none),
#[cfg(feature = "xdg-portal")]
crate::theme::portal::desktop_settings()
.map(Message::DesktopSettings)
Expand All @@ -230,6 +224,11 @@ where
);
}

#[cfg(feature = "single-instance")]
if self.app.core().single_instance {
subscriptions.push(super::single_instance_subscription::<T>());
}

Subscription::batch(subscriptions)
}

Expand Down

0 comments on commit 54ea121

Please sign in to comment.