diff --git a/packages/core/src/Stores/notification-store.js b/packages/core/src/Stores/notification-store.js index 1b8c6b895220..a61d1f069ed9 100644 --- a/packages/core/src/Stores/notification-store.js +++ b/packages/core/src/Stores/notification-store.js @@ -1,5 +1,4 @@ import React from 'react'; -import debounce from 'lodash.debounce'; import { action, computed, makeObservable, observable, reaction } from 'mobx'; import { StaticUrl } from '@deriv/components'; import { @@ -84,8 +83,6 @@ export default class NotificationStore extends BaseStore { updateNotifications: action.bound, }); - const debouncedGetP2pCompletedOrders = debounce(this.getP2pCompletedOrders, 1000); - reaction( () => root_store.common.app_routing_history.map(i => i.pathname), () => { @@ -114,7 +111,7 @@ export default class NotificationStore extends BaseStore { Object.keys(root_store.client.landing_companies || {}).length > 0 && root_store.client.is_p2p_enabled ) { - await debouncedGetP2pCompletedOrders(); + await this.getP2pCompletedOrders(); } if ( @@ -1508,8 +1505,8 @@ export default class NotificationStore extends BaseStore { await WS.wait('authorize'); const response = await WS.send?.({ p2p_order_list: 1, active: 0 }); - if (!response?.error) { - this.p2p_completed_orders = response?.p2p_order_list?.list || []; + if (!response?.error && response?.p2p_order_list?.list) { + this.p2p_completed_orders = response.p2p_order_list.list; } } }