Merge branch 'fixes' into 'main'

Various fixes

See merge request framasoft/mobilizon!1447
This commit is contained in:
Thomas Citharel 2023-09-05 14:34:23 +00:00
commit f3ea98822b
5 changed files with 34 additions and 18 deletions

View file

@ -290,7 +290,7 @@ build-and-push-docker-tag:
# Packaging app for amd64 # Packaging app for amd64
package-app: package-app:
image: mobilizon/buildpack:1.14.1-erlang-25.1.1-debian-buster image: mobilizon/buildpack:1.15.5-erlang-26.0.2-debian-buster
stage: package stage: package
variables: &release-variables variables: &release-variables
MIX_ENV: "prod" MIX_ENV: "prod"

View file

@ -11,7 +11,12 @@ export function fetchTags(text: string): Promise<ITag[]> {
}) })
); );
onResult(({ data }) => resolve(data.tags)); onResult((result) => {
if (result.loading) {
return;
}
return resolve(result.data.tags);
});
onError((error) => reject(error)); onError((error) => reject(error));
}); });

View file

@ -68,7 +68,13 @@ const { onResult, onError, loading } = useQuery<{
}) })
); );
onResult(async ({ data: { interact } }) => { onResult(async (result) => {
if (result.loading) return;
if (!result.data) {
errors.push(t("This URL is not supported"));
return;
}
const interact = result.data.interact;
switch (interact.__typename) { switch (interact.__typename) {
case "Group": case "Group":
await router.replace({ await router.replace({

View file

@ -22,6 +22,10 @@ defmodule Mobilizon.Service.Activity.Participant do
event = Events.get_event!(event_id) event = Events.get_event!(event_id)
subject = Keyword.fetch!(options, :subject) subject = Keyword.fetch!(options, :subject)
if is_nil(event.attributed_to_id) do
# No activity for non-group events
{:ok, nil}
else
ActivityBuilder.enqueue(:build_activity, %{ ActivityBuilder.enqueue(:build_activity, %{
"type" => "event", "type" => "event",
"subject" => subject, "subject" => subject,
@ -37,6 +41,7 @@ defmodule Mobilizon.Service.Activity.Participant do
"inserted_at" => DateTime.utc_now() "inserted_at" => DateTime.utc_now()
}) })
end end
end
@impl Activity @impl Activity
def insert_activity(_, _), do: {:ok, nil} def insert_activity(_, _), do: {:ok, nil}

View file

@ -103,7 +103,7 @@ defmodule Mobilizon.Service.ActorSuspension do
end) end)
end end
defp maybe_reset_actor_id(%Multi{} = multi, %Actor{type: :Group} = _actor) do defp maybe_reset_actor_id(%Multi{} = multi, %Actor{type: _} = _actor) do
multi multi
end end