diff --git a/intro/part6/src/Avatar.elm b/intro/part6/src/Avatar.elm index 0eac0dd..a2938f3 100644 --- a/intro/part6/src/Avatar.elm +++ b/intro/part6/src/Avatar.elm @@ -40,12 +40,12 @@ src (Avatar maybeUrl) = resolveAvatarUrl : Maybe String -> String resolveAvatarUrl maybeUrl = - {- 👉 TODO #1 of 2: return the user's avatar from maybeUrl, if maybeUrl actually - contains one. If maybeUrl is Nothing, return this URL instead: + case maybeUrl of + Just url -> + url - https://static.productionready.io/images/smiley-cyrus.jpg - -} - "" + Nothing -> + "https://static.productionready.io/images/smiley-cyrus.jpg" encode : Avatar -> Value diff --git a/intro/part6/src/Page/Article/Editor.elm b/intro/part6/src/Page/Article/Editor.elm index 04a89e4..d36b864 100644 --- a/intro/part6/src/Page/Article/Editor.elm +++ b/intro/part6/src/Page/Article/Editor.elm @@ -572,6 +572,7 @@ toTagList tagString = -} String.split " " tagString |> List.map String.trim + |> List.filter (\str -> str /= "") edit : Slug -> TrimmedForm -> Cred -> Http.Request (Article Full)