⚡ Optimized cookie consent toast
This commit is contained in:
@@ -185,40 +185,13 @@
|
|||||||
this.showInstallPrompt = await intializePwa();
|
this.showInstallPrompt = await intializePwa();
|
||||||
let cookiesAllowed = localStorage.getItem('cookiesAllowed') === 'yes';
|
let cookiesAllowed = localStorage.getItem('cookiesAllowed') === 'yes';
|
||||||
if(!cookiesAllowed) {
|
if(!cookiesAllowed) {
|
||||||
this.$toast.show('We use cookies for analytics and to improve our site', {
|
this.$toast.show('We use cookies', {
|
||||||
icon: 'info',
|
icon: 'info',
|
||||||
duration: 0,
|
duration: 5000,
|
||||||
|
theme: 'toasted-primary',
|
||||||
action: [
|
action: [
|
||||||
{
|
{
|
||||||
text: 'Deny',
|
text: 'Dismiss',
|
||||||
onClick: (e, toastObject) => {
|
|
||||||
toastObject.goAway(0);
|
|
||||||
this.$toast.error("HTTP service won't work without your consent", {
|
|
||||||
icon: 'error',
|
|
||||||
duration: 0,
|
|
||||||
action: [
|
|
||||||
{
|
|
||||||
text: 'Leave',
|
|
||||||
onClick: (e, toastObject) => {
|
|
||||||
this.$router.push({
|
|
||||||
path: '/websocket'
|
|
||||||
});
|
|
||||||
toastObject.goAway(0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'Opt-in',
|
|
||||||
onClick: (e, toastObject) => {
|
|
||||||
localStorage.setItem('cookiesAllowed', 'yes');
|
|
||||||
toastObject.goAway(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'Accept',
|
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
localStorage.setItem('cookiesAllowed', 'yes');
|
localStorage.setItem('cookiesAllowed', 'yes');
|
||||||
toastObject.goAway(0);
|
toastObject.goAway(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user