web: debug search for tag:letterbox instead of is:unread
This commit is contained in:
@@ -2,7 +2,7 @@ use std::collections::HashSet;
|
||||
|
||||
use graphql_client::GraphQLQuery;
|
||||
use log::{error, info};
|
||||
use seed::{app::subs, prelude::*, *};
|
||||
use seed::{prelude::*, *};
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::{
|
||||
@@ -13,10 +13,22 @@ use crate::{
|
||||
graphql::{front_page_query::*, send_graphql, show_thread_query::*},
|
||||
};
|
||||
|
||||
/// Used to fake the unread string while in development
|
||||
pub fn unread_query() -> &'static str {
|
||||
let host = seed::window()
|
||||
.location()
|
||||
.host()
|
||||
.expect("failed to get host");
|
||||
if host.starts_with("6758.") {
|
||||
return "tag:letterbox";
|
||||
}
|
||||
"is:unread"
|
||||
}
|
||||
|
||||
// `init` describes what should happen when your app started.
|
||||
pub fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
|
||||
if url.hash().is_none() {
|
||||
orders.request_url(urls::search("is:unread", 0));
|
||||
orders.request_url(urls::search(unread_query(), 0));
|
||||
} else {
|
||||
orders.notify(subs::UrlRequested::new(url));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user