From 3afa0566189bbd702cb89201fa3c85a48a2d881e Mon Sep 17 00:00:00 2001 From: davidvader Date: Fri, 2 Feb 2024 10:25:38 -0600 Subject: [PATCH] refactor: organize msg --- src/elm/Shared.elm | 16 ++++++++-------- src/elm/Shared/Msg.elm | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/elm/Shared.elm b/src/elm/Shared.elm index 30e13c25d..54c9d8326 100644 --- a/src/elm/Shared.elm +++ b/src/elm/Shared.elm @@ -243,6 +243,14 @@ update route msg model = , Effect.none ) + -- FAVICON + Shared.Msg.UpdateFavicon options -> + let + ( newFavicon, updateFavicon ) = + Favicons.updateFavicon model.favicon options.favicon + in + ( { model | favicon = newFavicon }, updateFavicon |> Effect.sendCmd ) + -- TIME Shared.Msg.AdjustTimeZone options -> ( { model | zone = options.zone } @@ -610,14 +618,6 @@ update route msg model = Interval.FiveSeconds -> ( model, Effect.none ) - -- FAVICON - Shared.Msg.UpdateFavicon options -> - let - ( newFavicon, updateFavicon ) = - Favicons.updateFavicon model.favicon options.favicon - in - ( { model | favicon = newFavicon }, updateFavicon |> Effect.sendCmd ) - subscriptions : Route () -> Model -> Sub Msg subscriptions _ model = diff --git a/src/elm/Shared/Msg.elm b/src/elm/Shared/Msg.elm index ee25a10a0..06e7f6a96 100644 --- a/src/elm/Shared/Msg.elm +++ b/src/elm/Shared/Msg.elm @@ -29,6 +29,8 @@ type Msg | OnKeyDown { key : String } | OnKeyUp { key : String } | VisibilityChanged { visibility : Browser.Events.Visibility } + -- FAVICON + | UpdateFavicon { favicon : Favicons.Favicon } -- TIME | AdjustTimeZone { zone : Time.Zone } | AdjustTime { time : Time.Posix } @@ -60,5 +62,3 @@ type Msg | HandleHttpError (Http.Detailed.Error String) -- REFRESH | Tick { interval : Interval.Interval, time : Time.Posix } - -- FAVICON - | UpdateFavicon { favicon : Favicons.Favicon }