Apply suggestion to lib/pleroma/web/masto_fe_controller.ex

This commit is contained in:
Alexander Strizhakov 2020-06-17 15:37:27 +00:00
parent 46492a2aee
commit 9f33c5fe63
No known key found for this signature in database
GPG Key ID: 022896A53AEF1381

View File

@ -56,12 +56,8 @@ defmodule Pleroma.Web.MastoFEController do
with {:ok, user} <- User.mastodon_settings_update(user, settings) do
if settings = get_in(user.settings, ["notifications", "shows"]) do
notify_settings =
Enum.map(settings, fn {k, v} ->
if v == false do
k
end
end)
|> Enum.filter(& &1)
Enum.map(settings, fn {k, v} -> if v == false, do: k end)
|> Enum.reject(&is_nil/1)
notification_settings =
user.notification_settings