commit fc6bcd41b6ed883a0f6f8a5ce11899fd4d144eca
parent 77bf5835ef7b63d5868991169001cea1f3479d46
Author: Marcel <mtrnord1@gmail.com>
Date: Tue, 26 May 2020 16:57:13 +0200
Cleanup debug code
Took 2 minutes
Diffstat:
5 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/src/app.rs b/src/app.rs
@@ -67,8 +67,6 @@ impl Component for App {
match response {
Response::Error(_) => {}
Response::LoggedIn(logged_in) => {
- info!("client_logged_in");
- info!("{}", logged_in);
let route: Route = if logged_in {
//self.state.logged_in = true;
@@ -80,7 +78,6 @@ impl Component for App {
AppRoute::Login.into()
};
- info!("{:#?}", route.clone());
self.route = Some(route.clone());
self.route_agent.send(ChangeRoute(route));
}
@@ -96,21 +93,17 @@ impl Component for App {
}
fn view(&self) -> Html {
- info!("rendered App!");
- info!("Route: {:#?}", &self.route);
html! {
{
match &self.route {
- None => {info!("NoneRoute"); html! {<Login />}},
+ None => html! {<Login />},
Some(route) => match AppRoute::switch(route.clone()) {
Some(AppRoute::MainView) => {
- info!("MainViewRoute");
html! {
<MainView />
}
},
Some(AppRoute::Login) => {
- info!("StartRoute");
html! {
<Login />
}
diff --git a/src/app/matrix.rs b/src/app/matrix.rs
@@ -77,7 +77,6 @@ impl Agent for MatrixAgent {
None
}
};
- info!("session: {:#?}", session);
MatrixAgent {
link,
matrix_state: Default::default(),
@@ -154,13 +153,10 @@ impl Agent for MatrixAgent {
storage.store(AUTH_KEY, Json(&session_store));
}
- info!("did login");
let resp = Response::LoggedIn(true);
- info!("prepared login response");
for sub in subscribers.iter() {
agent.link.respond(*sub, resp.clone());
}
- info!("sent login response");
});
}
Request::GetLoggedIn => {
diff --git a/src/app/matrix/sync.rs b/src/app/matrix/sync.rs
@@ -32,7 +32,6 @@ where
}
async fn on_sync_response(&self, response: SyncResponse) {
- info!("Synced");
for (room_id, room) in response.rooms.join {
for event in room.timeline.events {
@@ -44,7 +43,7 @@ where
}
async fn on_room_message(&self, room_id: &RoomId, event: RoomEvent) {
- // TODO handle all messages... (Extra class?)
+ // TODO handle all messages...
let msg_body = if let RoomEvent::RoomMessage(MessageEvent {
content: MessageEventContent::Text(TextMessageEventContent { body: msg_body, .. }),
..
@@ -55,7 +54,6 @@ where
return;
};
- info!("Received message event {:?}", &msg_body);
let resp = Response::Sync(msg_body);
(self.callback)(resp);
}
diff --git a/src/app/views/login.rs b/src/app/views/login.rs
@@ -57,7 +57,6 @@ impl Component for Login {
true
}
Msg::Login => {
- info!("Start Login");
self.matrix_agent.send(Request::Login());
false
}
@@ -70,7 +69,6 @@ impl Component for Login {
}
fn view(&self) -> Html {
- info!("rendered Login!");
html! {
<div class="container h-100">
<div class="row align-items-center h-100">
diff --git a/src/app/views/main_view.rs b/src/app/views/main_view.rs
@@ -44,11 +44,7 @@ impl Component for MainView {
fn update(&mut self, msg: Self::Message) -> bool {
match msg {
Msg::NewMessage(response) => {
- info!("NewMessage: {:#?}", response);
match response {
- Response::LoggedIn(v) => {
- info!("client_logged_in: {}", v);
- }
Response::Sync(msg) => {
// TODO handle all events
self.state.events.insert(msg);
@@ -65,7 +61,6 @@ impl Component for MainView {
}
fn view(&self) -> Html {
- info!("rendered MainView!");
html! {
<div class="container-fluid h-100">
<div class="row">