Skip to content

Commit

Permalink
1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
István Kreisz authored and István Kreisz committed Jul 28, 2021
1 parent e3374ef commit dda2b5e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
8 changes: 7 additions & 1 deletion electron/databaseCoordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ const databaseCoordinator = () => {
) {
return exchangeRates;
} else {
return { usd: 1.1891, gbp: 0.8567, chf: 1.0954, nok: 10.2673 };
return {
usd: 1.1891,
gbp: 0.8567,
chf: 1.0954,
nok: 10.2673,
updated: new Date().getTime(),
};
}
};

Expand Down
6 changes: 4 additions & 2 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { app, BrowserWindow } from 'electron';
import * as path from 'path';
import {
nodeAPI,
calculatePrices,
promiseAllSkippingErrors,
isOlderThan,
itemBestPrice,
Expand Down Expand Up @@ -256,7 +257,7 @@ const updatePrices = async (forced: boolean = false) => {
nodeAPI
.getItemPrices(item, apiConfig())
.then((result) => {
resolve(result);
resolve(calculatePrices(result, apiConfig()));
})
.catch((err) => {
reject(err);
Expand All @@ -281,7 +282,8 @@ const updatePrices = async (forced: boolean = false) => {

const fetchAndSave = async (item: Item) => {
const settings = getSettings();
const newItem = await nodeAPI.getItemPrices(item, apiConfig());
let newItem = await nodeAPI.getItemPrices(item, apiConfig());
newItem = calculatePrices(newItem, apiConfig());
updateItem(newItem, !app.isPackaged);
return newItem;
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CopDeck",
"version": "1.1.5",
"version": "1.1.6",
"author": "CopDeck",
"description": "CopDeck Sneaker Monitor",
"homepage": ".",
Expand All @@ -14,7 +14,7 @@
"@craco/craco": "^6.1.2",
"@headlessui/react": "^1.2.0",
"@heroicons/react": "^1.0.1",
"@istvankreisz/copdeck-scraper": "1.2.6",
"@istvankreisz/copdeck-scraper": "^1.3.1",
"@tailwindcss/forms": "^0.3.2",
"@tailwindcss/line-clamp": "^0.2.1",
"@types/node": "^15.6.1",
Expand Down
16 changes: 10 additions & 6 deletions src/Components/ItemDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,17 @@ const ItemDetail = (prop: {
.find((s) => s.store.id === store.id)
?.inventory.find((inventoryItem) => inventoryItem.size === size);
const storeInfo = prop.selectedItem.storeInfo.find((s) => s.store.id === store.id);
const ask = prices?.lowestAsk;
const bid = prices?.highestBid;
let askPrice: number | null | undefined = ask?.noFees;
let bidPrice: number | null | undefined = bid?.noFees;
let askPrice: number | null | undefined = prices?.lowestAsk;
let bidPrice: number | null | undefined = prices?.highestBid;
if (feeType !== 'None') {
askPrice = feeType === 'Buy' ? ask?.withBuyerFees : ask?.withSellerFees;
bidPrice = feeType === 'Buy' ? bid?.withBuyerFees : bid?.withSellerFees;
askPrice =
feeType === 'Buy'
? prices?.lowestAskWithBuyerFees
: prices?.lowestAskWithSellerFees;
bidPrice =
feeType === 'Buy'
? prices?.highestBidWithBuyerFees
: prices?.highestBidWithSellerFees;
}
const askInfo: [string, number] = askPrice
? [prop.currency.symbol + askPrice, askPrice]
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1622,16 +1622,16 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz"
integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==

"@istvankreisz/copdeck-scraper@1.2.6":
version "1.2.6"
resolved "https://registry.yarnpkg.com/@istvankreisz/copdeck-scraper/-/copdeck-scraper-1.2.6.tgz#6da612b855a7b9ea3bdc9e0a7abca014dd5ca1b2"
integrity sha512-ZLgE82LhrwM5X8HpT9K1jaqjKR2GMeOJwSyPar8lClVgn9Juoe9SxQbBdFMX1HKd5pDQeks4qjffHD5FKUoLZA==
"@istvankreisz/copdeck-scraper@^1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@istvankreisz/copdeck-scraper/-/copdeck-scraper-1.3.1.tgz#bf5018f76c4df896074c5d9cc34e94b94dae87b4"
integrity sha512-5nrvf4e7E2WqSbqesIYYXYxTp7Z/zvJUMvpaHoN6ftI6+ig1kLQ25sXGOvtvuu0NMW8zcFvqBXSB9ou+AIJGhg==
dependencies:
fast-xml-parser "^3.19.0"
https-proxy-agent "^5.0.0"
node-fetch "^2.6.1"
superstruct "^0.15.2"
user-agents "^1.0.681"
user-agents "^1.0.726"

"@jest/console@^26.6.2":
version "26.6.2"
Expand Down Expand Up @@ -12644,10 +12644,10 @@ use@^3.1.0:
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz"
integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==

user-agents@^1.0.681:
version "1.0.709"
resolved "https://registry.yarnpkg.com/user-agents/-/user-agents-1.0.709.tgz#bdef0a16e726a9f76c305addb5887f9dd6a95862"
integrity sha512-QveBZyUhLLzK/mU8JTLFRmk+ZOXts98EJycEzsfZ5wpGMay2rMdmArg2CouaOdpNQ7a/F7v1PyRyNH72Xc7KlQ==
user-agents@^1.0.726:
version "1.0.726"
resolved "https://registry.yarnpkg.com/user-agents/-/user-agents-1.0.726.tgz#9a22bcc6197551653e64c75ac2c0458ad8ddb39a"
integrity sha512-FZknASSz6EizoHoLGXbkfE9rgj0PH2grJ/BmMM9Fffd8pL3qBDpWhp0hqcA2XYlRL1vXfq5/W9RcSPKtcdhIzQ==
dependencies:
dot-json "^1.2.2"
lodash.clonedeep "^4.5.0"
Expand Down

0 comments on commit dda2b5e

Please sign in to comment.