The base64 always starts with "g" so that's another character we can save
This commit is contained in:
parent
bc7227c5bd
commit
d9974a3288
|
@ -28,7 +28,7 @@ import List.Extra exposing (elemIndex, getAt)
|
|||
import Maybe exposing (andThen)
|
||||
import Maybe.Extra exposing (isJust)
|
||||
import Result exposing (toMaybe)
|
||||
import String exposing (fromInt, isEmpty, replace, toLower)
|
||||
import String exposing (dropLeft, fromInt, isEmpty, replace, toLower)
|
||||
import String.Extra exposing (isBlank)
|
||||
import Svg exposing (path, Svg, svg)
|
||||
import Svg.Attributes exposing (d, fill, height, stroke, viewBox, width)
|
||||
|
@ -394,6 +394,7 @@ save model =
|
|||
|> CE.encode
|
||||
|> B64E.bytes
|
||||
|> B64E.encode
|
||||
|> dropLeft 1
|
||||
|> replace "=" ""
|
||||
|> (++) "#"
|
||||
|> pushUrl model.browserKey
|
||||
|
@ -401,6 +402,7 @@ save model =
|
|||
load : Key -> Url -> Maybe Model
|
||||
load key url =
|
||||
url.fragment
|
||||
|> Maybe.map ((++) "g")
|
||||
|> andThen (B64D.decode B64D.bytes >> toMaybe)
|
||||
|> andThen (CD.decode (loadModel key))
|
||||
|
||||
|
|
Loading…
Reference in a new issue