Rust service refactor: friends & some other

This commit is contained in:
2026-03-10 13:27:12 +08:00
parent e38697faa9
commit 3437bc5746
17 changed files with 84 additions and 93 deletions

View File

@@ -3,7 +3,7 @@ use crate::{
remotes::{dolls::DollsRemote, friends::FriendRemote, user::UserRemote},
services::{
app_events::{ActiveDollSpriteChanged, AppDataRefreshed},
friend_active_doll_sprite, friend_cursor, sprite,
friends, sprite,
},
state::FDOLL,
};
@@ -165,8 +165,7 @@ pub async fn init_app_data_scoped(scope: AppDataRefreshScope) {
let mut guard = lock_w!(crate::state::FDOLL);
guard.user_data.friends = Some(friends);
drop(guard);
friend_active_doll_sprite::sync_from_app_data();
friend_cursor::sync_from_app_data();
friends::sync_from_app_data();
}
Err(e) => {
warn!("Failed to fetch friends list: {}", e);
@@ -287,6 +286,5 @@ pub fn clear_app_data() {
guard.user_data.user = None;
guard.user_data.friends = None;
drop(guard);
friend_active_doll_sprite::clear();
friend_cursor::clear();
friends::clear();
}