Skip to content

Commit

Permalink
allow overriding options for createTradeManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jd1378 committed Feb 11, 2021
1 parent 8b1c7d5 commit e1e7c56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/trade_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ export async function createTradeManager(
} = options || {};
const tradeManager = new TradeManager({
communityOptions: {
...communityOptions,
loadCookies: (username) => {
return CryptStorage.loadData(
`comm_cookies_${username}.bin`,
Expand All @@ -227,9 +226,9 @@ export async function createTradeManager(
saveCookies: async (data, username) => {
await CryptStorage.saveData(`comm_cookies_${username}.bin`, data);
},
...communityOptions,
},
pollingOptions: {
...pollingOptions,
loadPollData: (username) => {
return Storage.loadData(`poll_data_${username}.json`) as Promise<
PollData
Expand All @@ -238,6 +237,7 @@ export async function createTradeManager(
savePollData: async (data, username) => {
await Storage.saveData(`poll_data_${username}.json`, data);
},
...pollingOptions,
},
...otherOptions,
});
Expand Down

0 comments on commit e1e7c56

Please sign in to comment.