Skip to content

Commit

Permalink
fix: order complete toast message disappeares immediately (binary-com…
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-nurzi-deriv committed Oct 4, 2023
1 parent 2c82757 commit 8f862fc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/core/src/Stores/notification-store.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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),
() => {
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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;
}
}
}

0 comments on commit 8f862fc

Please sign in to comment.