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 client = reqwest::Client::new();
|
||||||
|
|
||||||
let url = api!() + format!("app/v1/auth/logout?{:?}", state.token).as_str();
|
let url = api!() + format!("app/v1/auth/logout?{:?}", state.token).as_str();
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
mod download;
|
mod download;
|
||||||
mod jnovel;
|
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 iced::widget::{button, column, text, Column, container, toggler::{Toggler}, pick_list, row, Row, text_input};
|
||||||
use std::fmt::{Display, Formatter};
|
use std::fmt::{Display, Formatter};
|
||||||
use arrayvec::ArrayString;
|
use chrono::{Local};
|
||||||
use chrono::{DateTime, Local, Utc};
|
|
||||||
use reqwest::StatusCode;
|
|
||||||
use serde::{Deserialize};
|
use serde::{Deserialize};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -121,7 +119,7 @@ impl Application for CalibreWebImporter {
|
||||||
println!("Logging out from J-Novel Club");
|
println!("Logging out from J-Novel Club");
|
||||||
self.jnc.token = None;
|
self.jnc.token = None;
|
||||||
self.jnc.login_state = jnovel::LoginState::LoggedOut;
|
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) => {
|
jnovel::Message::LoginState(status) => {
|
||||||
if let jnovel::LoginState::Success(token) = status {
|
if let jnovel::LoginState::Success(token) = status {
|
||||||
|
|
Reference in a new issue