From 9d7dd59bd0d95003d4c4056881f9f8565e459f6d Mon Sep 17 00:00:00 2001 From: Anders Ekelund Date: Mon, 17 May 2021 09:50:37 +0200 Subject: [PATCH] Replace deprecated Vue.prototype. --- hooks/afterRegistration.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hooks/afterRegistration.ts b/hooks/afterRegistration.ts index 70bdd7b..fa32304 100755 --- a/hooks/afterRegistration.ts +++ b/hooks/afterRegistration.ts @@ -1,6 +1,7 @@ import Vue from 'vue' import { isServer } from '@vue-storefront/core/helpers' import * as types from '../store/mutation-types' +import EventBus from '@vue-storefront/core/compatibility/plugins/event-bus' export function afterRegistration(config, store) { const VSF_PAYPAL_CODE = 'paypal_express' @@ -8,18 +9,18 @@ export function afterRegistration(config, store) { const placeOrder = () => { if (correctPaymentMethod) { - // Vue.prototype.$bus.$emit('checkout-do-placeOrder', {}) + // EventBus.$emit('checkout-do-placeOrder', {}) } } if (!isServer) { - Vue.prototype.$bus.$on('set-unique-payment-methods', methods => { + EventBus.$on('set-unique-payment-methods', methods => { store.commit(`payment-paypal-magento2/${types.SET_BACKEND_PAYMENT_PAYPAL_EXPRESS}`, methods) }) - Vue.prototype.$bus.$on('checkout-before-placeOrder', placeOrder) + EventBus.$on('checkout-before-placeOrder', placeOrder) - Vue.prototype.$bus.$on('checkout-payment-method-changed', (paymentMethodCode) => { + EventBus.$on('checkout-payment-method-changed', (paymentMethodCode) => { correctPaymentMethod = paymentMethodCode === VSF_PAYPAL_CODE }) }