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,20 +22,25 @@ 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)
ActivityBuilder.enqueue(:build_activity, %{ if is_nil(event.attributed_to_id) do
"type" => "event", # No activity for non-group events
"subject" => subject, {:ok, nil}
"subject_params" => %{ else
actor_name: Actor.display_name(actor), ActivityBuilder.enqueue(:build_activity, %{
event_title: event.title, "type" => "event",
event_uuid: event.uuid "subject" => subject,
}, "subject_params" => %{
"group_id" => event.attributed_to_id, actor_name: Actor.display_name(actor),
"author_id" => actor.id, event_title: event.title,
"object_type" => "participant", event_uuid: event.uuid
"object_id" => participant_id, },
"inserted_at" => DateTime.utc_now() "group_id" => event.attributed_to_id,
}) "author_id" => actor.id,
"object_type" => "participant",
"object_id" => participant_id,
"inserted_at" => DateTime.utc_now()
})
end
end end
@impl Activity @impl Activity

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