1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-26 09:49:12 +00:00

Show a proper error message when failure to register to an event

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-10-27 18:12:48 +02:00
parent 0bc48560e8
commit 231f99cd1e
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -375,6 +375,7 @@ import { ApolloCache, FetchResult } from "@apollo/client/core";
import { useMutation } from "@vue/apollo-composable"; import { useMutation } from "@vue/apollo-composable";
import { useCreateReport } from "@/composition/apollo/report"; import { useCreateReport } from "@/composition/apollo/report";
import { useDeleteEvent } from "@/composition/apollo/event"; import { useDeleteEvent } from "@/composition/apollo/event";
import { useProgrammatic } from "@oruga-ui/oruga-next";
const ShareEventModal = defineAsyncComponent( const ShareEventModal = defineAsyncComponent(
() => import("@/components/Event/ShareEventModal.vue") () => import("@/components/Event/ShareEventModal.vue")
@ -609,7 +610,17 @@ onJoinEventMutationDone(({ data }) => {
} }
}); });
const { oruga } = useProgrammatic();
onJoinEventMutationError((error) => { onJoinEventMutationError((error) => {
if (error.message) {
oruga.notification.open({
message: error.message,
variant: "danger",
position: "bottom-right",
duration: 5000,
});
}
console.error(error); console.error(error);
}); });