Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 4ee2a6c

Browse files
authored
Merge pull request #1592 from mahdiyeh-fs/fix_balance_update_on_closing_contract
Mahdiyeh/ Fix: blance get updated when contract is closed
2 parents c6a2df2 + 2b4e00a commit 4ee2a6c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/trade/tradeConf.es6

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,18 @@ export const init = (data, extra, showCallback, hideCallback) => {
369369
};
370370

371371
const view = rv.bind(root[0], state);
372-
373372
if(!state.arrow.visible) { registerTicks(state, extra); }
374-
else { state.back.visible = true; }
373+
else {
374+
state.back.visible = true;
375+
liveapi.events.on('balance', data => {
376+
if (local_storage.get("authorize")) {
377+
const loginId = local_storage.get('authorize').loginid;
378+
if (data.balance && data.balance.loginid === loginId && state.buy.balance_after !== data.balance.balance ) {
379+
state.buy.balance_after = data.balance.balance;
380+
};
381+
}
382+
});
383+
}
375384

376385
showCallback(root);
377386
}

0 commit comments

Comments
 (0)