Skip to content

Commit

Permalink
Kate / Fix: last_contract was not defined on the first page load (#10398
Browse files Browse the repository at this point in the history
)

* fix: add check for existing keys in localstorage

* fix: add observable into getter

* refactor: remove boolean

* fix: add clear contract function in onmount

* fix: add new observable into the getter
  • Loading branch information
kate-deriv authored and vinu-deriv committed Oct 10, 2023
1 parent e8b890c commit 36e3065
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/Stores/contract-trade-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export default class ContractTradeStore extends BaseStore {

get last_contract() {
const applicable_contracts = this.applicable_contracts();
const length = applicable_contracts.length;
const length = this.contracts[0]?.contract_info.current_spot_time ? applicable_contracts.length : -1;
return length > 0 ? applicable_contracts[length - 1] : {};
}

Expand Down

0 comments on commit 36e3065

Please sign in to comment.