mirror of
https://github.com/Orasund/elm-ui-widgets.git
synced 2024-11-22 04:58:49 +03:00
Merge pull request #81 from orus-io/explorer-relative-url-in-flags
explorer: fix loading null settings from localStorage
This commit is contained in:
commit
bb7538e413
@ -17032,28 +17032,40 @@ var $author$project$UIExplorer$Settings = function (dark) {
|
|||||||
};
|
};
|
||||||
var $elm$json$Json$Decode$bool = _Json_decodeBool;
|
var $elm$json$Json$Decode$bool = _Json_decodeBool;
|
||||||
var $elm$json$Json$Decode$decodeString = _Json_runOnString;
|
var $elm$json$Json$Decode$decodeString = _Json_runOnString;
|
||||||
var $author$project$UIExplorer$decodeSettings = A2(
|
var $author$project$UIExplorer$decodeSettings = $elm$json$Json$Decode$oneOf(
|
||||||
$elm$json$Json$Decode$field,
|
_List_fromArray(
|
||||||
'settings',
|
[
|
||||||
A2(
|
A2(
|
||||||
$elm$json$Json$Decode$andThen,
|
$elm$json$Json$Decode$field,
|
||||||
function (s) {
|
'settings',
|
||||||
var _v0 = A2(
|
A2(
|
||||||
$elm$json$Json$Decode$decodeString,
|
$elm$json$Json$Decode$andThen,
|
||||||
A2(
|
function (s) {
|
||||||
$elm$json$Json$Decode$map,
|
var _v0 = A2(
|
||||||
$author$project$UIExplorer$Settings,
|
$elm$json$Json$Decode$decodeString,
|
||||||
A2($elm$json$Json$Decode$field, 'dark', $elm$json$Json$Decode$bool)),
|
A2(
|
||||||
s);
|
$elm$json$Json$Decode$map,
|
||||||
if (!_v0.$) {
|
$author$project$UIExplorer$Settings,
|
||||||
var settings = _v0.a;
|
$elm$json$Json$Decode$oneOf(
|
||||||
return $elm$json$Json$Decode$succeed(settings);
|
_List_fromArray(
|
||||||
} else {
|
[
|
||||||
return $elm$json$Json$Decode$succeed(
|
A2($elm$json$Json$Decode$field, 'dark', $elm$json$Json$Decode$bool),
|
||||||
{a1: false});
|
$elm$json$Json$Decode$succeed(true)
|
||||||
}
|
]))),
|
||||||
},
|
s);
|
||||||
$elm$json$Json$Decode$string));
|
if (!_v0.$) {
|
||||||
|
var settings = _v0.a;
|
||||||
|
return $elm$json$Json$Decode$succeed(settings);
|
||||||
|
} else {
|
||||||
|
var err = _v0.a;
|
||||||
|
return $elm$json$Json$Decode$fail(
|
||||||
|
$elm$json$Json$Decode$errorToString(err));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
$elm$json$Json$Decode$string)),
|
||||||
|
$elm$json$Json$Decode$succeed(
|
||||||
|
{a1: false})
|
||||||
|
]));
|
||||||
var $author$project$Main$decodeFlags = A3(
|
var $author$project$Main$decodeFlags = A3(
|
||||||
$elm$json$Json$Decode$map2,
|
$elm$json$Json$Decode$map2,
|
||||||
$author$project$Main$Flags,
|
$author$project$Main$Flags,
|
||||||
|
56
docs/main.js
56
docs/main.js
@ -17032,28 +17032,40 @@ var $author$project$UIExplorer$Settings = function (dark) {
|
|||||||
};
|
};
|
||||||
var $elm$json$Json$Decode$bool = _Json_decodeBool;
|
var $elm$json$Json$Decode$bool = _Json_decodeBool;
|
||||||
var $elm$json$Json$Decode$decodeString = _Json_runOnString;
|
var $elm$json$Json$Decode$decodeString = _Json_runOnString;
|
||||||
var $author$project$UIExplorer$decodeSettings = A2(
|
var $author$project$UIExplorer$decodeSettings = $elm$json$Json$Decode$oneOf(
|
||||||
$elm$json$Json$Decode$field,
|
_List_fromArray(
|
||||||
'settings',
|
[
|
||||||
A2(
|
A2(
|
||||||
$elm$json$Json$Decode$andThen,
|
$elm$json$Json$Decode$field,
|
||||||
function (s) {
|
'settings',
|
||||||
var _v0 = A2(
|
A2(
|
||||||
$elm$json$Json$Decode$decodeString,
|
$elm$json$Json$Decode$andThen,
|
||||||
A2(
|
function (s) {
|
||||||
$elm$json$Json$Decode$map,
|
var _v0 = A2(
|
||||||
$author$project$UIExplorer$Settings,
|
$elm$json$Json$Decode$decodeString,
|
||||||
A2($elm$json$Json$Decode$field, 'dark', $elm$json$Json$Decode$bool)),
|
A2(
|
||||||
s);
|
$elm$json$Json$Decode$map,
|
||||||
if (!_v0.$) {
|
$author$project$UIExplorer$Settings,
|
||||||
var settings = _v0.a;
|
$elm$json$Json$Decode$oneOf(
|
||||||
return $elm$json$Json$Decode$succeed(settings);
|
_List_fromArray(
|
||||||
} else {
|
[
|
||||||
return $elm$json$Json$Decode$succeed(
|
A2($elm$json$Json$Decode$field, 'dark', $elm$json$Json$Decode$bool),
|
||||||
{a1: false});
|
$elm$json$Json$Decode$succeed(true)
|
||||||
}
|
]))),
|
||||||
},
|
s);
|
||||||
$elm$json$Json$Decode$string));
|
if (!_v0.$) {
|
||||||
|
var settings = _v0.a;
|
||||||
|
return $elm$json$Json$Decode$succeed(settings);
|
||||||
|
} else {
|
||||||
|
var err = _v0.a;
|
||||||
|
return $elm$json$Json$Decode$fail(
|
||||||
|
$elm$json$Json$Decode$errorToString(err));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
$elm$json$Json$Decode$string)),
|
||||||
|
$elm$json$Json$Decode$succeed(
|
||||||
|
{a1: false})
|
||||||
|
]));
|
||||||
var $author$project$Main$decodeFlags = A3(
|
var $author$project$Main$decodeFlags = A3(
|
||||||
$elm$json$Json$Decode$map2,
|
$elm$json$Json$Decode$map2,
|
||||||
$author$project$Main$Flags,
|
$author$project$Main$Flags,
|
||||||
|
@ -69,23 +69,30 @@ type alias Settings =
|
|||||||
|
|
||||||
decodeSettings : Decode.Decoder Settings
|
decodeSettings : Decode.Decoder Settings
|
||||||
decodeSettings =
|
decodeSettings =
|
||||||
Decode.string
|
Decode.oneOf
|
||||||
|> Decode.andThen
|
[ Decode.string
|
||||||
(\s ->
|
|> Decode.andThen
|
||||||
case
|
(\s ->
|
||||||
Decode.decodeString
|
case
|
||||||
(Decode.map Settings
|
Decode.decodeString
|
||||||
(Decode.field "dark" Decode.bool)
|
(Decode.map Settings
|
||||||
)
|
(Decode.oneOf
|
||||||
s
|
[ Decode.field "dark" Decode.bool
|
||||||
of
|
, Decode.succeed True
|
||||||
Ok settings ->
|
]
|
||||||
Decode.succeed settings
|
)
|
||||||
|
)
|
||||||
|
s
|
||||||
|
of
|
||||||
|
Ok settings ->
|
||||||
|
Decode.succeed settings
|
||||||
|
|
||||||
Err _ ->
|
Err err ->
|
||||||
Decode.succeed { dark = False }
|
Decode.fail <| Decode.errorToString err
|
||||||
)
|
)
|
||||||
|> Decode.field "settings"
|
|> Decode.field "settings"
|
||||||
|
, Decode.succeed { dark = False }
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
saveSettings : Settings -> Cmd msg
|
saveSettings : Settings -> Cmd msg
|
||||||
|
Loading…
Reference in New Issue
Block a user