Skip to content

Commit

Permalink
Merge pull request #966 from the-hideout/feature/fix_history_and_cont…
Browse files Browse the repository at this point in the history
…ainers

Fix history and containers
  • Loading branch information
Shebuka authored Jul 23, 2024
2 parents cf6e8f1 + 0df06b2 commit 83d8d13
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/components/api-metrics-graph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ function ApiMetricsGraph({ graph }) {
return "⚠️ Error Fetching API Metrics";
}

if (status !== 'succeeded') {
if (status !== 'success') {
return null;
}

if (status === 'succeeded' && data.heartbeatList["1"] === 0) {
if (status === 'success' && data.heartbeatList["1"] === 0) {
return `⚠️ ${t('No data')}`;
}

Expand Down
12 changes: 6 additions & 6 deletions src/components/price-graph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ function PriceGraph({ item, itemId }) {
const gameMode = useSelector((state) => state.settings.gameMode);
const { status, data } = useQuery(
`historical-price-${itemId}`,
`{
historicalItemPrices(id:"${itemId}", gameMode: ${gameMode}){
`query TarkovDevHistorical {
historicalItemPrices(id: "${itemId}", gameMode: ${gameMode}) {
price
priceMin
timestamp
}
}`,
}`.replace(/\s{2,}/g, ' '),
);

const { dayTicks, tickLabels } = useMemo(() => {
const returnValues = {
dayTicks: [],
tickLabels: {},
};
if (status !== 'succeeded' || !data?.data?.historicalItemPrices) {
if (status !== 'success' || !data?.data?.historicalItemPrices) {
return returnValues;
}
returnValues.dayTicks = data.data.historicalItemPrices.reduce((all, current) => {
Expand Down Expand Up @@ -121,11 +121,11 @@ function PriceGraph({ item, itemId }) {
height = 1280;
}

if (status !== 'succeeded' || !data?.data?.historicalItemPrices) {
if (status !== 'success' || !data?.data?.historicalItemPrices) {
return null;
}

if (status === 'succeeded' && data.data.historicalItemPrices.length < 2) {
if (status === 'success' && data.data.historicalItemPrices.length < 2) {
return t('No data');
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/server-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import './index.css';
function ServerStatus() {
const { status, data } = useQuery(
`server-status`,
`{
`query TarkovDevStatus {
status {
generalStatus {
name
Expand All @@ -24,15 +24,15 @@ function ServerStatus() {
solveTime
}
}
}`,
}`.replace(/\s{2,}/g, ' '),
);
const { t } = useTranslation();

if (status !== 'succeeded' || !data.data.status) {
if (status !== 'success' || !data.data.status) {
return null;
}

if (status === 'succeeded' && data.data.status.length === 0) {
if (status === 'success' && data.data.status.length === 0) {
return t('No data');
}

Expand Down
2 changes: 1 addition & 1 deletion src/features/crafts/do-fetch-crafts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CraftsQuery extends APIQuery {
id
}
}
}`;
}`.replace(/\s{2,}/g, ' ');

const craftsData = await this.graphqlRequest(query);

Expand Down
6 changes: 3 additions & 3 deletions src/features/items/do-fetch-items.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class ItemsQuery extends APIQuery {
sellOfferFeeRate
sellRequirementFeeRate
}
}`),
}`.replace(/\s{2,}/g, ' ')),
new Promise(resolve => {
if (prebuild) {
return resolve({});
Expand Down Expand Up @@ -478,12 +478,12 @@ class ItemsQuery extends APIQuery {
gridPockets = itemGrids[rawItem.id];
}
else if (rawItem.properties.grids.length === 1) {
gridPockets = {
gridPockets = [{
row: 0,
col: 0,
width: rawItem.properties.grids[0].width,
height: rawItem.properties.grids[0].height,
};
}];
}

if (gridPockets.length > 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@ The max profitable price is impacted by the intel center and hideout management
<div className="icon-and-link-wrapper">
{currentItemData.grid && (
<CanvasGrid
width={currentItemData.grid.width}
height={currentItemData.grid.height}
grid={currentItemData.grid.pockets}
width={currentItemData.grid.width}
/>
)}
<ItemImage
Expand Down

0 comments on commit 83d8d13

Please sign in to comment.