Skip to content

Commit

Permalink
Merge branch 'main' into tweak-factory-map-tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz authored Aug 10, 2023
2 parents a5a07ba + 86c99d3 commit 4646873
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/components/menu/alert-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const alertConfig = {
// set this bool if the site alert should be enabled or not
alertEnabled: false,
alertEnabled: true,

// valid alert colors
alertColors: {
Expand All @@ -14,11 +14,16 @@ const alertConfig = {
alertLevel: 'info',

// The text to display in the alert banner
text: 'If you enjoy using tarkov.dev, please consider donating to help keep it running. All donations go directly towards server costs and operational expenses. This banner will only be up for a week. Thank you! ❤️',
text: 'We are currently leveling our scanners for patch 0.13.5 - If you enjoy using tarkov.dev, please consider donating to help keep it running. All donations go directly towards server costs and operational expenses. This banner will only be up for a week. Thank you! ❤️',

linkEnabled: true,
linkText: 'Donate',
link: 'https://opencollective.com/tarkov-dev',

// when a banner with a specific key is hidden, it never shows for that user again
// (unless they clear their browser cache)
// use a different key to force new banners to display again
bannerKey: 'alertBanner-0.13.5'
}

export default alertConfig
2 changes: 1 addition & 1 deletion src/components/menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const Menu = () => {
setIsOpen(!isOpen);
};*/
const { t } = useTranslation();
const [open, setOpen] = useStateWithLocalStorage('alertBanner', true);
const [open, setOpen] = useStateWithLocalStorage(alertConfig.bannerKey, true);

const mapImages = useMapImages();
const uniqueMaps = Object.values(mapImages);
Expand Down
7 changes: 4 additions & 3 deletions src/features/items/do-fetch-items.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,11 @@ class ItemsQuery extends APIQuery {
data: {
items: [],
},
errors: [],
};
while (true) {
const itemBatch = await this.graphqlRequest(QueryBody(offset));
if (itemBatch.errors) {
if (!retrievedItems.errors) {
retrievedItems.errors = [];
}
retrievedItems.errors.concat(itemBatch.errors);
}
if (itemBatch.data && itemBatch.data.items) {
Expand All @@ -466,6 +464,9 @@ class ItemsQuery extends APIQuery {
}
offset += itemLimit;
}
if (retrievedItems.errors.length < 1) {
retrievedItems.errors = undefined;
}
resolve(retrievedItems);
}),
this.graphqlRequest(`{
Expand Down

0 comments on commit 4646873

Please sign in to comment.