2020-06-11 10:58:23 +02:00
< template >
< div v-if ="loggedUser" >
< section >
< div class = "setting-title" >
< h2 > { { $t ( "Participation notifications" ) } } < / h2 >
< / div >
< div class = "field" >
< strong > { {
2020-06-16 16:15:38 +02:00
$t (
"Mobilizon will send you an email when the events you are attending have important changes: date and time, address, confirmation or cancellation, etc."
)
2020-06-11 10:58:23 +02:00
} } < / strong >
< p >
2020-06-16 16:15:38 +02:00
{ { $t ( "Other notification options:" ) } }
2020-06-11 10:58:23 +02:00
< / p >
< / div >
< div class = "field" >
2022-07-12 10:55:28 +02:00
< o -checkbox
2020-11-30 10:24:11 +01:00
v - model = "notificationOnDay"
@ input = "updateSetting({ notificationOnDay })"
>
2020-06-11 10:58:23 +02:00
< strong > { { $t ( "Notification on the day of the event" ) } } < / strong >
< p >
{ {
2020-11-30 10:24:11 +01:00
$t (
"We'll use your timezone settings to send a recap of the morning of the event."
)
2020-06-11 10:58:23 +02:00
} }
< / p >
2022-07-12 10:55:28 +02:00
< / o - c h e c k b o x >
2020-06-11 10:58:23 +02:00
< / div >
2020-11-30 10:24:11 +01:00
< p >
{ {
$t (
"To activate more notifications, head over to the notification settings."
)
} }
< / p >
2020-06-11 10:58:23 +02:00
< / section >
< / div >
< / template >
2022-07-12 10:55:28 +02:00
< script lang = "ts" setup >
// import { SnackbarProgrammatic as Snackbar } from "buefy";
import { doUpdateSetting , useUserSettings } from "@/composition/apollo/user" ;
import { onMounted , ref } from "vue" ;
2020-06-11 10:58:23 +02:00
2022-07-12 10:55:28 +02:00
const notificationOnDay = ref ( true ) ;
2020-06-11 10:58:23 +02:00
2022-07-12 10:55:28 +02:00
const { loggedUser } = useUserSettings ( ) ;
2020-06-11 10:58:23 +02:00
2022-07-12 10:55:28 +02:00
const updateSetting = async (
variables : Record < string , unknown >
) : Promise < void > => {
try {
doUpdateSetting ( variables ) ;
} catch ( e : any ) {
// Snackbar.open({
// message: e.message,
2022-08-26 16:08:58 +02:00
// variant: "danger",
// position: "bottom",
2022-07-12 10:55:28 +02:00
// });
2020-06-11 10:58:23 +02:00
}
2022-07-12 10:55:28 +02:00
} ;
onMounted ( ( ) => {
doUpdateSetting ( {
notificationOnDay : true ,
notificationEachWeek : false ,
notificationBeforeEvent : false ,
} ) ;
} ) ;
2020-06-11 10:58:23 +02:00
< / script >