Skip to content

Commit

Permalink
refactor: more comprehensible zero_upsell expire calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Bedon committed Dec 5, 2023
1 parent 1b9f6d9 commit 368c8d8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ import HeartIcon from '@/assets/icons/inline/heart-icon.svg';
import HowKivaUsesDonation from '@/components/Checkout/HowKivaUsesDonation';
import { gql } from '@apollo/client';
import { readBoolSetting } from '@/util/settingsUtils';
import { add } from 'date-fns';
import KvButton from '~/@kiva/kv-components/vue/KvButton';
import KvLightbox from '~/@kiva/kv-components/vue/KvLightbox';
import KvMaterialIcon from '~/@kiva/kv-components/vue/KvMaterialIcon';
Expand Down Expand Up @@ -188,8 +189,7 @@ export default {
setDonationAndClose(amount, source) {
const zeroUpsellCookie = this.cookieStore.get('zero_upsell_visible') || true;
if (amount === 0) {
const expires = new Date();
expires.setTime(expires.getTime() + (24 * 60 * 60 * 1000));
const expires = add(new Date(), { days: 1 });
this.cookieStore.set('zero_upsell_visible', false, { expires });
this.$kvTrackEvent('basket', 'click', `Update Nudge Donation - ${source}`, amount * 100);
}
Expand Down

0 comments on commit 368c8d8

Please sign in to comment.