From 70ede19c50a1957ecb51cc8d99f22eadc05e31b1 Mon Sep 17 00:00:00 2001 From: Ronan Date: Sun, 28 Jul 2024 23:15:52 -0600 Subject: [PATCH] Remove countdown --- elm.json | 2 +- src/Main.elm | 1 - src/Types.elm | 2 -- src/Update.elm | 7 ------- src/View.elm | 53 +------------------------------------------------- 5 files changed, 2 insertions(+), 63 deletions(-) diff --git a/elm.json b/elm.json index b3d4b00..69b8ee8 100644 --- a/elm.json +++ b/elm.json @@ -12,7 +12,6 @@ "elm/html": "1.0.0", "elm/json": "1.1.3", "elm/svg": "1.0.1", - "elm/time": "1.0.0", "elmcraft/core-extra": "2.0.0", "mdgriffith/elm-ui": "1.1.8", "ronanyeah/helpers": "6.0.0" @@ -22,6 +21,7 @@ "elm/file": "1.0.5", "elm/http": "2.0.0", "elm/regex": "1.0.0", + "elm/time": "1.0.0", "elm/url": "1.0.0", "elm/virtual-dom": "1.0.2", "myrho/elm-round": "1.0.5" diff --git a/src/Main.elm b/src/Main.elm index 3e7de05..9907388 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -32,7 +32,6 @@ init flags = , claimStatus = Standby , showSecret = False , confirmDelete = False - , currentTime = flags.time , tokenRefreshInProgress = False , miningError = Nothing , stats = Nothing diff --git a/src/Types.elm b/src/Types.elm index 7230ff3..ce7cd9f 100644 --- a/src/Types.elm +++ b/src/Types.elm @@ -17,7 +17,6 @@ type alias Model = , confirmDelete : Bool , tokenRefreshInProgress : Bool , addressInput : String - , currentTime : Int , miningError : Maybe String , hashesChecked : Int , stats : Maybe (Maybe Ports.Stats) @@ -55,7 +54,6 @@ type Msg | MiningError String | StatsCb Ports.Stats | SwapDataCb Ports.SwapData - | Tick Int | ManageCoins diff --git a/src/Update.elm b/src/Update.elm index 1461301..f7e3837 100644 --- a/src/Update.elm +++ b/src/Update.elm @@ -11,13 +11,6 @@ import Utils exposing (..) update : Msg -> Model -> ( Model, Cmd Msg ) update msg model = case msg of - Tick n -> - ( { model - | currentTime = n - } - , Cmd.none - ) - ClearWallet -> if model.confirmDelete then ( { model diff --git a/src/View.elm b/src/View.elm index 03e7045..4b4e2ed 100644 --- a/src/View.elm +++ b/src/View.elm @@ -14,10 +14,6 @@ import Types exposing (..) import Utils exposing (..) -startTime = - 0 - - view : Model -> Html Msg view model = [ [ logo 70 @@ -34,30 +30,7 @@ view model = ] |> row [ spacing 10, centerX ] |> when False - , if startTime < model.currentTime then - viewBody model - - else - [ [ Img.x 20 - , text ".com/MineralSupply" - |> el [ Font.size 22 ] - ] - |> row [] - |> linkOut "https://twitter.com/MineralSupply" [] - , timeDifference model.currentTime startTime - |> (\( hours, mins, seconds ) -> - [ String.padLeft 2 '0' (String.fromInt hours) - , ":" - , String.padLeft 2 '0' (String.fromInt mins) - , ":" - , String.padLeft 2 '0' (String.fromInt seconds) - ] - |> String.concat - ) - |> text - |> el [ Font.size 50, centerX ] - ] - |> column [ centerX, spacing 20 ] + , viewBody model ] |> column [ cappedWidth 450 @@ -881,30 +854,6 @@ horizRule = el [ width fill, height <| px 2, Background.color white ] none -timeDifference : Int -> Int -> ( Int, Int, Int ) -timeDifference timestamp1 timestamp2 = - let - diffMillis = - abs (timestamp1 - timestamp2) - - totalSeconds = - diffMillis // 1000 - - hours = - totalSeconds // 3600 - - remainingSecondsAfterHours = - modBy 3600 totalSeconds - - minutes = - remainingSecondsAfterHours // 60 - - seconds = - modBy 60 remainingSecondsAfterHours - in - ( hours, minutes, seconds ) - - formatMINE n d = formatFloatN d (toFloat n / 1000000000)