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" >
< b -checkbox v-model ="notificationOnDay" @input="updateSetting({ notificationOnDay })" >
< strong > { { $t ( "Notification on the day of the event" ) } } < / strong >
< p >
{ {
$t ( "We'll use your timezone settings to send a recap of the morning of the event." )
} }
< / p >
< / b - c h e c k b o x >
< / div >
< p > { { $t ( "To activate more notifications, head over to the notification settings." ) } } < / p >
< / section >
< / div >
< / template >
< script lang = "ts" >
2020-11-13 13:39:52 +01:00
import { Component } from "vue-property-decorator" ;
2020-09-29 09:53:48 +02:00
import { SnackbarProgrammatic as Snackbar } from "buefy" ;
2020-11-13 13:39:52 +01:00
import { mixins } from "vue-class-component" ;
import Onboarding from "../../mixins/onboarding" ;
2020-06-11 10:58:23 +02:00
2020-11-13 13:39:52 +01:00
@ Component
export default class NotificationsOnboarding extends mixins ( Onboarding ) {
2020-06-11 10:58:23 +02:00
notificationOnDay = true ;
2020-11-13 13:39:52 +01:00
mounted ( ) : void {
this . doUpdateSetting ( {
notificationOnDay : true ,
notificationEachWeek : false ,
notificationBeforeEvent : false ,
} ) ;
}
2020-06-11 10:58:23 +02:00
2020-09-29 09:53:48 +02:00
async updateSetting ( variables : Record < string , unknown > ) : Promise < void > {
try {
2020-11-13 13:39:52 +01:00
this . doUpdateSetting ( variables ) ;
2020-09-29 09:53:48 +02:00
} catch ( e ) {
Snackbar . open ( { message : e . message , type : "is-danger" , position : "is-bottom" } ) ;
}
2020-06-11 10:58:23 +02:00
}
}
< / script >