diff --git a/assets/src/Elm/Version.elm b/assets/src/Elm/Version.elm index 16f41f50..0c77e2d7 100644 --- a/assets/src/Elm/Version.elm +++ b/assets/src/Elm/Version.elm @@ -1,4 +1,4 @@ -module Elm.Version exposing (Version, compare, decoder, encoder, eq, fromString, toString) +module Elm.Version exposing (Version, compare, compatible, decoder, encoder, eq, fromString, toString) import Json.Decode as Decode exposing (Decoder) import Json.Encode as Encode exposing (Value) @@ -25,6 +25,11 @@ fromString str = Err "Expecting a version like MAJOR.MINOR.PATCH" +compatible : Version -> Version -> Bool +compatible left right = + ( left.major, left.minor ) == ( left.major, left.minor ) + + eq : Version -> Version -> Bool eq left right = case compare left right of diff --git a/assets/src/Pages/Editor/Views/Workbench.elm b/assets/src/Pages/Editor/Views/Workbench.elm index 27193fbf..818ac567 100644 --- a/assets/src/Pages/Editor/Views/Workbench.elm +++ b/assets/src/Pages/Editor/Views/Workbench.elm @@ -174,7 +174,7 @@ viewErrorsHeader pane config = _ -> Button.none } - , if Version.eq config.compilerVersion Compiler.version then + , if Version.compatible config.compilerVersion Compiler.version then Just { label = if config.saving then @@ -236,7 +236,7 @@ viewFinishedHeader pane canDebug config = _ -> Button.none } - , if Version.eq config.compilerVersion Compiler.version then + , if Version.compatible config.compilerVersion Compiler.version then Just { icon = Just Icon.Upload , label = "Save"