move crate root feature module files into folders

This commit is contained in:
2026-09-01 22:04:36 +08:00
parent 9041283b65
commit 3c1cc256c7
11 changed files with 25 additions and 17 deletions
+6 -4
View File
@@ -28,7 +28,7 @@ pub struct FriendForegroundAppChanged {
}
#[derive(Default)]
pub struct ForegroundAppState(RwLock<HashMap<String, AppMeta>>);
pub(crate) struct ForegroundAppState(RwLock<HashMap<String, AppMeta>>);
impl ForegroundAppState {
fn update(&self, user_id: String, meta: AppMeta) -> Result<(), String> {
@@ -103,10 +103,12 @@ where
// no-op on unsupported platforms
}
/// Initializes the foreground app change listener
/// and emits events to the Tauri app on changes.
/// Used for app to emit user foreground app to peers.
pub fn init(handle: &AppHandle) {
handle.manage(ForegroundAppState::default());
}
/// Starts the foreground app change listener after network state is available.
pub fn start(handle: &AppHandle) {
update_local_app(handle, current_app());
let handle = handle.clone();