From af9c7e0aff550de8c6998062d44e5324afd83262 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Thu, 10 Jun 2021 19:26:03 +0530 Subject: [PATCH] feat: add FundOSS toast --- components/app/Header.vue | 56 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/components/app/Header.vue b/components/app/Header.vue index e0fb80be8..af6b9b4df 100644 --- a/components/app/Header.vue +++ b/components/app/Header.vue @@ -212,34 +212,34 @@ export default { }) } - // let showAd = localStorage.getItem("showAd") === "no" - // if (!showAd) { - // setTimeout(() => { - // this.$toast.clear() - // this.$toast.show( - // "Sponsor us to support Hoppscotch open source project 💖
Whoosh this away to dismiss.
", - // { - // icon: "", - // duration: 0, - // theme: "toasted-ad", - // action: [ - // { - // text: "Sponsor", - // icon: "chevron_right", - // onClick: (_, toastObject) => { - // localStorage.setItem("showAd", "no") - // toastObject.goAway(0) - // window.open("https://github.com/sponsors/hoppscotch") - // }, - // }, - // ], - // onComplete() { - // localStorage.setItem("showAd", "no") - // }, - // } - // ) - // }, 8000) - // } + const showAd = localStorage.getItem("showAd") === "no" + if (!showAd) { + setTimeout(() => { + this.$toast.clear() + this.$toast.show( + "Sponsor us to support Hoppscotch open source project 💖
Whoosh this away to dismiss.
", + { + icon: "", + duration: 0, + theme: "toasted-ad", + action: [ + { + text: "Donate", + icon: "chevron_right", + onClick: (_, toastObject) => { + localStorage.setItem("showAd", "no") + toastObject.goAway(0) + window.open("https://fundoss.org/collective/hoppscotch") + }, + }, + ], + onComplete() { + localStorage.setItem("showAd", "no") + }, + } + ) + }, 6000) + } // let showExtensionsToast = localStorage.getItem("showExtensionsToast") === "yes" // if (!showExtensionsToast) {