Fix not fetching only local communities
This commit is contained in:
parent
a36115d6e6
commit
a366ba9ca1
2 changed files with 5 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
use std::{fs::{self, OpenOptions}, path::Path, io::Write, thread::sleep, time};
|
use std::{fs::{self, OpenOptions}, path::Path, io::Write, thread::sleep, time};
|
||||||
|
|
||||||
use lemmy_api_common::{sensitive::Sensitive, post::CreatePost, community::{self, ListCommunities, ListCommunitiesResponse}};
|
use lemmy_api_common::{sensitive::Sensitive, post::CreatePost, community::{self, ListCommunities, ListCommunitiesResponse}};
|
||||||
use lemmy_db_schema::newtypes::{LanguageId, CommunityId};
|
use lemmy_db_schema::{newtypes::{LanguageId, CommunityId}, ListingType};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
@ -271,6 +271,7 @@ impl CommunitiesVector {
|
||||||
pub(crate) fn load(&mut self, auth: &Sensitive<String>, base: &String) {
|
pub(crate) fn load(&mut self, auth: &Sensitive<String>, base: &String) {
|
||||||
let params = ListCommunities {
|
let params = ListCommunities {
|
||||||
auth: Some(auth.clone()),
|
auth: Some(auth.clone()),
|
||||||
|
type_: Some(ListingType::Local),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -134,6 +134,7 @@ fn run_bot(mut terminal: Terminal<CrosstermBackend<&io::Stdout>>) {
|
||||||
loop {
|
loop {
|
||||||
let _ = enable_raw_mode();
|
let _ = enable_raw_mode();
|
||||||
let _ = execute!(terminal.backend_mut(), EnterAlternateScreen, EnableMouseCapture);
|
let _ = execute!(terminal.backend_mut(), EnterAlternateScreen, EnableMouseCapture);
|
||||||
|
|
||||||
this.run_once(old);
|
this.run_once(old);
|
||||||
|
|
||||||
// Update UI
|
// Update UI
|
||||||
|
@ -141,8 +142,8 @@ fn run_bot(mut terminal: Terminal<CrosstermBackend<&io::Stdout>>) {
|
||||||
ui(f, &this);
|
ui(f, &this);
|
||||||
}).unwrap();
|
}).unwrap();
|
||||||
|
|
||||||
thread::sleep(Duration::from_secs(5));
|
this.idle();
|
||||||
|
|
||||||
disable_raw_mode().unwrap();
|
disable_raw_mode().unwrap();
|
||||||
execute!(
|
execute!(
|
||||||
terminal.backend_mut(),
|
terminal.backend_mut(),
|
||||||
|
@ -150,8 +151,6 @@ fn run_bot(mut terminal: Terminal<CrosstermBackend<&io::Stdout>>) {
|
||||||
DisableMouseCapture
|
DisableMouseCapture
|
||||||
).unwrap();
|
).unwrap();
|
||||||
terminal.show_cursor().unwrap();
|
terminal.show_cursor().unwrap();
|
||||||
|
|
||||||
this.idle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue