2020-06-11 08:58:23 +00:00
< template >
< div v-if ="loggedUser" >
< section >
< div class = "setting-title" >
< h2 > { { $t ( "Participation notifications" ) } } < / h2 >
< / div >
< div class = "field" >
< strong > { {
2020-06-16 14:15:38 +00: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 08:58:23 +00:00
} } < / strong >
< p >
2020-06-16 14:15:38 +00:00
{ { $t ( "Other notification options:" ) } }
2020-06-11 08:58:23 +00:00
< / p >
< / div >
< div class = "field" >
2021-11-18 08:49:00 +00:00
< o -checkbox
2020-11-30 09:24:11 +00:00
v - model = "notificationOnDay"
@ input = "updateSetting({ notificationOnDay })"
>
2020-06-11 08:58:23 +00:00
< strong > { { $t ( "Notification on the day of the event" ) } } < / strong >
< p >
{ {
2020-11-30 09:24:11 +00:00
$t (
"We'll use your timezone settings to send a recap of the morning of the event."
)
2020-06-11 08:58:23 +00:00
} }
< / p >
2021-11-18 08:49:00 +00:00
< / o - c h e c k b o x >
2020-06-11 08:58:23 +00:00
< / div >
2020-11-30 09:24:11 +00:00
< p >
{ {
$t (
"To activate more notifications, head over to the notification settings."
)
} }
< / p >
2020-06-11 08:58:23 +00:00
< / section >
< / div >
< / template >
< script lang = "ts" >
2021-11-18 16:50:54 +00:00
// import { SnackbarProgrammatic as Snackbar } from "buefy";
import { mixins } from "vue-property-decorator" ;
2020-11-13 12:39:52 +00:00
import Onboarding from "../../mixins/onboarding" ;
2020-06-11 08:58:23 +00:00
2020-11-13 12:39:52 +00:00
export default class NotificationsOnboarding extends mixins ( Onboarding ) {
2020-06-11 08:58:23 +00:00
notificationOnDay = true ;
2020-11-13 12:39:52 +00:00
mounted ( ) : void {
this . doUpdateSetting ( {
notificationOnDay : true ,
notificationEachWeek : false ,
notificationBeforeEvent : false ,
} ) ;
}
2020-06-11 08:58:23 +00:00
2020-09-29 07:53:48 +00:00
async updateSetting ( variables : Record < string , unknown > ) : Promise < void > {
try {
2020-11-13 12:39:52 +00:00
this . doUpdateSetting ( variables ) ;
2021-09-29 16:20:33 +00:00
} catch ( e : any ) {
2021-11-18 16:50:54 +00:00
// Snackbar.open({
// message: e.message,
// type: "is-danger",
// position: "is-bottom",
// });
2020-09-29 07:53:48 +00:00
}
2020-06-11 08:58:23 +00:00
}
}
< / script >