fix cm
This commit is contained in:
parent
663c5bc355
commit
0e4e7fcb9b
@ -94,6 +94,9 @@ impl ConnectionManager {
|
||||
|
||||
fn remove_connection(&self, id: i32) {
|
||||
self.write().unwrap().senders.remove(&id);
|
||||
if self.read().unwrap().senders.len() == 0 {
|
||||
std::process::exit(0);
|
||||
}
|
||||
self.call("removeConnection", &make_args!(id));
|
||||
}
|
||||
|
||||
@ -315,10 +318,6 @@ impl ConnectionManager {
|
||||
}
|
||||
}
|
||||
|
||||
fn exit(&self) {
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
||||
fn t(&self, name: String) -> String {
|
||||
crate::client::translate(name)
|
||||
}
|
||||
@ -336,7 +335,6 @@ impl sciter::EventHandler for ConnectionManager {
|
||||
fn authorize(i32);
|
||||
fn switch_permission(i32, String, bool);
|
||||
fn send_msg(i32, String);
|
||||
fn exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,9 +296,7 @@ handler.removeConnection = function(id) {
|
||||
});
|
||||
if (i < 0) return;
|
||||
connections.splice(i, 1);
|
||||
if (connections.length == 0) {
|
||||
handler.exit();
|
||||
} else {
|
||||
if (connections.length > 0) {
|
||||
if (body.cur >= i && body.cur > 0) body.cur -= 1;
|
||||
update();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user