From 231f99cd1ed0ce5bb121b80c094240c677f423f9 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 27 Oct 2022 18:12:48 +0200 Subject: [PATCH] Show a proper error message when failure to register to an event Signed-off-by: Thomas Citharel --- js/src/components/Event/EventActionSection.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/src/components/Event/EventActionSection.vue b/js/src/components/Event/EventActionSection.vue index ecb8eb32..fbf21628 100644 --- a/js/src/components/Event/EventActionSection.vue +++ b/js/src/components/Event/EventActionSection.vue @@ -375,6 +375,7 @@ import { ApolloCache, FetchResult } from "@apollo/client/core"; import { useMutation } from "@vue/apollo-composable"; import { useCreateReport } from "@/composition/apollo/report"; import { useDeleteEvent } from "@/composition/apollo/event"; +import { useProgrammatic } from "@oruga-ui/oruga-next"; const ShareEventModal = defineAsyncComponent( () => import("@/components/Event/ShareEventModal.vue") @@ -609,7 +610,17 @@ onJoinEventMutationDone(({ data }) => { } }); +const { oruga } = useProgrammatic(); + onJoinEventMutationError((error) => { + if (error.message) { + oruga.notification.open({ + message: error.message, + variant: "danger", + position: "bottom-right", + duration: 5000, + }); + } console.error(error); });