diff --git a/src/components/menu/alert-config.js b/src/components/menu/alert-config.js index ebd8c1066..c74b548a6 100644 --- a/src/components/menu/alert-config.js +++ b/src/components/menu/alert-config.js @@ -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: { @@ -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 diff --git a/src/components/menu/index.js b/src/components/menu/index.js index 42fbef12b..3d823db1b 100644 --- a/src/components/menu/index.js +++ b/src/components/menu/index.js @@ -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); diff --git a/src/features/items/do-fetch-items.js b/src/features/items/do-fetch-items.js index 02a6d2263..65d0c9e01 100644 --- a/src/features/items/do-fetch-items.js +++ b/src/features/items/do-fetch-items.js @@ -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) { @@ -466,6 +464,9 @@ class ItemsQuery extends APIQuery { } offset += itemLimit; } + if (retrievedItems.errors.length < 1) { + retrievedItems.errors = undefined; + } resolve(retrievedItems); }), this.graphqlRequest(`{