diff --git a/web/src/Main.elm b/web/src/Main.elm index b1b0e0c..17bdc9e 100644 --- a/web/src/Main.elm +++ b/web/src/Main.elm @@ -74,7 +74,8 @@ type Msg | RssUpdated (Result Xml.Errors Feed) | SearchInputChanged String | SearchRequested - | UpdateRequested Time.Posix + | TimeChanged Time.Posix + | UpdateRequested | UrlChanged Url | UrlRequested UrlRequest | WindowResized Int Int @@ -994,9 +995,12 @@ update msg model = SearchRequested -> ( model, Nav.pushUrl model.navKey ("/last?_search=" ++ model.search) ) - UpdateRequested now -> + TimeChanged now -> ( { model | now = now }, getRss model.url ) + UpdateRequested -> + ( model, getRss model.url ) + UrlRequested urlRequest -> case urlRequest of Browser.Internal url -> @@ -1038,7 +1042,8 @@ toggle id set = subscriptions : Model -> Sub Msg subscriptions model = Sub.batch - [ Time.every (5 * 60 * 1000) UpdateRequested + [ Time.every (5 * 60 * 1000) (always UpdateRequested) + , Time.every (60 * 1000) TimeChanged , Browser.Events.onResize WindowResized ] diff --git a/web/static/index.html b/web/static/index.html index c41a019..07b25f4 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -10,7 +10,7 @@ - +