mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
Merge pull request #329 from gerlofvanek/fixes-19
Fix: Offers - when table is updated, the filters aren't applied.
This commit is contained in:
@@ -793,7 +793,7 @@ async function fetchOffers() {
|
|||||||
|
|
||||||
CacheManager.set('offers_cached', jsonData, 'offers');
|
CacheManager.set('offers_cached', jsonData, 'offers');
|
||||||
|
|
||||||
await updateOffersTable();
|
applyFilters();
|
||||||
updatePaginationInfo();
|
updatePaginationInfo();
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -804,7 +804,7 @@ async function fetchOffers() {
|
|||||||
if (cachedOffers?.value) {
|
if (cachedOffers?.value) {
|
||||||
jsonData = cachedOffers.value;
|
jsonData = cachedOffers.value;
|
||||||
originalJsonData = [...jsonData];
|
originalJsonData = [...jsonData];
|
||||||
await updateOffersTable();
|
applyFilters();
|
||||||
}
|
}
|
||||||
ui.displayErrorMessage('Failed to fetch offers. Please try again later.');
|
ui.displayErrorMessage('Failed to fetch offers. Please try again later.');
|
||||||
} finally {
|
} finally {
|
||||||
@@ -2270,10 +2270,10 @@ function initializeTableEvents() {
|
|||||||
if (!priceData && previousPrices) {
|
if (!priceData && previousPrices) {
|
||||||
console.log('Using previous price data after failed refresh');
|
console.log('Using previous price data after failed refresh');
|
||||||
latestPrices = previousPrices;
|
latestPrices = previousPrices;
|
||||||
await updateOffersTable();
|
applyFilters();
|
||||||
} else if (priceData) {
|
} else if (priceData) {
|
||||||
latestPrices = priceData;
|
latestPrices = priceData;
|
||||||
await updateOffersTable();
|
applyFilters();
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Unable to fetch price data');
|
throw new Error('Unable to fetch price data');
|
||||||
}
|
}
|
||||||
@@ -2291,7 +2291,7 @@ function initializeTableEvents() {
|
|||||||
const cachedData = CacheManager.get('prices_coingecko');
|
const cachedData = CacheManager.get('prices_coingecko');
|
||||||
if (cachedData?.value) {
|
if (cachedData?.value) {
|
||||||
latestPrices = cachedData.value;
|
latestPrices = cachedData.value;
|
||||||
await updateOffersTable();
|
applyFilters();
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
window.isManualRefresh = false;
|
window.isManualRefresh = false;
|
||||||
@@ -2560,7 +2560,7 @@ document.addEventListener('DOMContentLoaded', async function() {
|
|||||||
latestPrices = previousPrices;
|
latestPrices = previousPrices;
|
||||||
}
|
}
|
||||||
|
|
||||||
await updateOffersTable();
|
applyFilters();
|
||||||
|
|
||||||
updateProfitLossDisplays();
|
updateProfitLossDisplays();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user