web: add tablet rendering, listen to window resize events.

This commit is contained in:
2023-12-02 10:56:14 -08:00
parent 4c2526c70b
commit 714b057fdb
5 changed files with 61 additions and 19 deletions

View File

@@ -19,6 +19,7 @@ pub fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
} else {
orders.notify(subs::UrlRequested::new(url));
};
orders.stream(streams::window_event(Ev::Resize, |_| Msg::OnResize));
orders.subscribe(on_url_changed);
Model {
@@ -127,6 +128,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
Msg::Reload => {
orders.perform_cmd(async move { on_url_changed(subs::UrlChanged(Url::current())) });
}
Msg::OnResize => (),
Msg::SearchRequest {
query,
@@ -357,6 +359,8 @@ pub enum Msg {
Noop,
// Tell the client to refresh its state
Reload,
// Window has changed size
OnResize,
// Tell the server to update state
RefreshStart,
RefreshDone(Option<FetchError>),