From 17dcb1826c474acc3ace86987949bcce013d60d3 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Thu, 28 May 2020 15:32:11 +0530 Subject: [PATCH] :alembic: Experimenting ad --- components/layout/header.vue | 45 +++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/components/layout/header.vue b/components/layout/header.vue index 485030b13..a5ddde5e7 100644 --- a/components/layout/header.vue +++ b/components/layout/header.vue @@ -342,27 +342,34 @@ export default { }) } - setTimeout(() => { - this.$toast.clear() - this.$toast.show( - "Get De-Coding The Passion Project book, expertly crafted by the creator of Postwoman", - { - icon: "", - duration: 0, - theme: "toasted-ad", - action: [ - { - text: "Get", - icon: "chevron_right", - onClick: (e, toastObject) => { - toastObject.goAway(0) - window.open("https://gum.co/keky") + let showAd = localStorage.getItem("showAd") === "no" + if (!showAd) { + setTimeout(() => { + this.$toast.clear() + this.$toast.show( + "Get De-Coding The Passion Project book, expertly crafted by the creator of Postwoman. Whoosh this away to dimiss →", + { + icon: "", + duration: 0, + theme: "toasted-ad", + action: [ + { + text: "Get", + icon: "chevron_right", + onClick: (e, toastObject) => { + localStorage.setItem("showAd", "no") + toastObject.goAway(0) + window.open("https://gum.co/keky") + }, }, + ], + onComplete() { + localStorage.setItem("showAd", "no") }, - ], - } - ) - }, 11000) + } + ) + }, 11000) + } let showExtensionsToast = localStorage.getItem("showExtensionsToast") === "yes"