Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start background matrix sync tasks on the Startup event #43

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Start background matrix sync tasks on the Startup event
This is more appropriate than doing so when the App widget is
created, as that can happen multiple times on Android, e.g.,
when switching apps.
  • Loading branch information
kevinaboos committed Feb 10, 2024
commit ed50803c3b1ea98b601ead93552f193cbba16700
75 changes: 42 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -256,14 +256,29 @@ impl LiveRegister for App {
crate::profile::my_profile_screen::live_design(cx);
}
}
impl LiveHook for App {
fn after_new_from_doc(&mut self, _cx: &mut Cx) {
log!("after_new_from_doc(): starting matrix sdk loop");
crate::sliding_sync::start_matrix_tokio().unwrap();
}
}

impl LiveHook for App { }

impl MatchEvent for App {
fn handle_startup(&mut self, _cx: &mut Cx) {
log!("App::handle_startup(): starting matrix sdk loop");
crate::sliding_sync::start_matrix_tokio().unwrap();
}
fn handle_shutdown(&mut self, _cx: &mut Cx) {
log!("App::handle_shutdown()");
}
fn handle_pause(&mut self, _cx: &mut Cx) {
log!("App::handle_pause()");
}
fn handle_resume(&mut self, _cx: &mut Cx) {
log!("App::handle_resume()");
}
fn handle_app_got_focus(&mut self, _cx: &mut Cx) {
log!("App::handle_app_got_focus()");
}
fn handle_app_lost_focus(&mut self, _cx: &mut Cx) {
log!("App::handle_app_lost_focus()");
}
fn handle_actions(&mut self, cx: &mut Cx, actions: &Actions) {
self.ui.radio_button_set(ids!(
mobile_modes.tab1,