Fix. Text clipboard is not working correctly (#7226)

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2024-02-22 13:44:44 +08:00
committed by GitHub
parent d7d7be9366
commit 09325fadaf
3 changed files with 7 additions and 13 deletions

View File

@@ -1790,13 +1790,10 @@ pub mod sessions {
#[inline]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub fn other_sessions_running(peer_id: String, conn_type: ConnType) -> bool {
SESSIONS
.read()
.unwrap()
.get(&(peer_id, conn_type))
.map(|s| s.session_handlers.read().unwrap().len() != 0)
.unwrap_or(false)
pub fn has_sessions_running(conn_type: ConnType) -> bool {
SESSIONS.read().unwrap().iter().any(|((_, r#type), s)| {
*r#type == conn_type && s.session_handlers.read().unwrap().len() != 0
})
}
}