Fix logout type mismatch + remove some unused imports
This commit is contained in:
parent
53e6f72cbb
commit
bd373bffae
2 changed files with 4 additions and 6 deletions
|
@ -49,7 +49,7 @@ impl State {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn logout(state: &Self) {
|
||||
pub(crate) async fn logout(state: State) {
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
let url = api!() + format!("app/v1/auth/logout?{:?}", state.token).as_str();
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
mod download;
|
||||
mod jnovel;
|
||||
|
||||
use iced::{Alignment, Application, Command, Element, executor, Length, Padding, Pixels, Settings, Subscription, subscription, Theme, time};
|
||||
use iced::{Application, Command, Element, executor, Length, Padding, Pixels, Settings, Subscription, subscription, Theme, time};
|
||||
use iced::widget::{button, column, text, Column, container, toggler::{Toggler}, pick_list, row, Row, text_input};
|
||||
use std::fmt::{Display, Formatter};
|
||||
use arrayvec::ArrayString;
|
||||
use chrono::{DateTime, Local, Utc};
|
||||
use reqwest::StatusCode;
|
||||
use chrono::{Local};
|
||||
use serde::{Deserialize};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -121,7 +119,7 @@ impl Application for CalibreWebImporter {
|
|||
println!("Logging out from J-Novel Club");
|
||||
self.jnc.token = None;
|
||||
self.jnc.login_state = jnovel::LoginState::LoggedOut;
|
||||
Command::perform(jnovel::State::logout(self.jnc.clone()), || Message::JncAction(jnovel::Message::LoginState(jnovel::LoginState::LoggedOut)))
|
||||
Command::perform(jnovel::State::logout(self.jnc.clone()), |()| Message::JncAction(jnovel::Message::LoginState(jnovel::LoginState::LoggedOut)))
|
||||
}
|
||||
jnovel::Message::LoginState(status) => {
|
||||
if let jnovel::LoginState::Success(token) = status {
|
||||
|
|
Reference in a new issue