app: replace ConsoleService with gloo_console

This commit is contained in:
Valentin Tolmer
2023-03-08 14:44:08 +01:00
committed by nitnelave
parent f44e8b7659
commit 8d44717588
9 changed files with 48 additions and 31 deletions

View File

@@ -23,13 +23,13 @@
use crate::infra::api::HostService;
use anyhow::{Error, Result};
use gloo_console::{error, log};
use graphql_client::GraphQLQuery;
use yew::{
prelude::*,
services::{
fetch::FetchTask,
reader::{FileData, ReaderService, ReaderTask},
ConsoleService,
},
};
use yewtil::NeqAssign;
@@ -100,7 +100,7 @@ impl<C: CommonComponent<C>> CommonComponentParts<C> {
com.mut_common().error = None;
match com.handle_msg(msg) {
Err(e) => {
ConsoleService::error(&e.to_string());
error!(&e.to_string());
com.mut_common().error = Some(e);
com.mut_common().cancel_task();
true
@@ -178,7 +178,7 @@ impl<C: CommonComponent<C>> CommonComponentParts<C> {
error_message,
)
.map_err::<(), _>(|e| {
ConsoleService::log(&e.to_string());
log!(&e.to_string());
self.error = Some(e);
})
.ok()