Skip to content

Commit

Permalink
fixed exchange rate subscription error (#6046)
Browse files Browse the repository at this point in the history
  • Loading branch information
farrah-deriv committed Jul 28, 2022
1 parent 4d0c79e commit 4dcf967
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/p2p/src/stores/floating-rate-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,14 @@ export default class FloatingRateStore extends BaseStore {

@action.bound
fetchExchangeRate(response) {
const { local_currency_config, ws_subscriptions } = this.root_store.general_store.client;
const { client, ws_subscriptions } = this.root_store.general_store;
if (response) {
if (response.error) {
this.setApiErrorMessage(response.error.message);
if (ws_subscriptions.exchange_rate_subscription.unsubscribe) {
ws_subscriptions.unsubscribe();
}
ws_subscriptions?.exchange_rate_subscription?.unsubscribe?.();
} else {
const { rates } = response.exchange_rates;
this.setExchangeRate(rates[local_currency_config?.currency]);
this.setExchangeRate(rates[client?.local_currency_config?.currency]);
this.setApiErrorMessage(null);
}
}
Expand Down

1 comment on commit 4dcf967

@vercel
Copy link

@vercel vercel bot commented on 4dcf967 Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
deriv-app-git-master.binary.sx
deriv-app.binary.sx
binary.sx

Please sign in to comment.