ui: fix Account watching bug

Account::is_online(&mut self) should be called from ui/src/state.rs
only, since it launches the watcher threads when an account goes from
offline to online. If it's called from elsewhere the watcher threads
might not get launched ever.
jmap
Manos Pitsidianakis 2019-11-12 13:07:00 +02:00
parent c9c4e1ea60
commit c6a4fcb959
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 2 additions and 1 deletions

View File

@ -279,7 +279,6 @@ impl Account {
event_queue: VecDeque::with_capacity(8),
};
ret.is_online();
ret
}
fn init(&mut self) {
@ -809,6 +808,8 @@ impl Account {
ret.as_ref().map(|r| r.0.as_str())
}
/* Call only in Context::is_online, since only Context can launch the watcher threads if an
* account goes from offline to online. */
pub fn is_online(&mut self) -> bool {
let ret = self.backend.read().unwrap().is_online();
if ret != self.is_online && ret {