Add refresh button and mobile view.

This commit is contained in:
2023-03-04 09:00:18 -08:00
parent c33f901f48
commit 0b4cfadf88
4 changed files with 111 additions and 14 deletions

View File

@@ -18,6 +18,10 @@ fn hello() -> &'static str {
"Hello, world!"
}
#[get("/refresh")]
async fn refresh(nm: &State<Notmuch>) -> Result<Json<String>, Debug<NotmuchError>> {
Ok(Json(String::from_utf8_lossy(&nm.new()?).to_string()))
}
#[get("/search")]
async fn search_all(nm: &State<Notmuch>) -> Result<Json<SearchSummary>, Debug<NotmuchError>> {
search(nm, "*").await
@@ -123,6 +127,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
original_part,
original,
hello,
refresh,
search_all,
search,
show_pretty,