mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-06 03:05:10 +02:00
Fix automatic refresh
This commit is contained in:
parent
3ddf1f2339
commit
a8f67f7e88
@ -30,9 +30,9 @@ const EventViewer = (obj) => {
|
|||||||
console.log("Rendering EventViewer");
|
console.log("Rendering EventViewer");
|
||||||
let unfiltered = 0;
|
let unfiltered = 0;
|
||||||
let filtered = 0;
|
let filtered = 0;
|
||||||
|
let hidden = 0;
|
||||||
let prevBlock = 0;
|
let prevBlock = 0;
|
||||||
let limitShown = obj.events.length + obj.tickets.length;
|
let limitShown = obj.events.length + obj.tickets.length;
|
||||||
let hasLimited = false;
|
|
||||||
|
|
||||||
let filterActivatedColour;
|
let filterActivatedColour;
|
||||||
filterActivatedColour = filterActivated ? activationColour : greyColour;
|
filterActivatedColour = filterActivated ? activationColour : greyColour;
|
||||||
@ -52,7 +52,7 @@ const EventViewer = (obj) => {
|
|||||||
unbondActivatedColour = unbondActivated ? unbondColour : greyColour;
|
unbondActivatedColour = unbondActivated ? unbondColour : greyColour;
|
||||||
|
|
||||||
const updateOnScroll = () => {
|
const updateOnScroll = () => {
|
||||||
if (!hasLimited) {
|
if (unfiltered == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (listInnerRef.current) {
|
if (listInnerRef.current) {
|
||||||
@ -102,6 +102,7 @@ const EventViewer = (obj) => {
|
|||||||
// Filter by minimum value
|
// Filter by minimum value
|
||||||
if (obj.amountFilter !== "") {
|
if (obj.amountFilter !== "") {
|
||||||
if (parseFloat(obj.amountFilter) > thisEvent.eventValue) {
|
if (parseFloat(obj.amountFilter) > thisEvent.eventValue) {
|
||||||
|
filtered++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,7 +112,10 @@ const EventViewer = (obj) => {
|
|||||||
if (thisEvent.eventCaller.toLowerCase().includes(obj.searchTerm.toLowerCase())) isFiltered = false;
|
if (thisEvent.eventCaller.toLowerCase().includes(obj.searchTerm.toLowerCase())) isFiltered = false;
|
||||||
if (thisEvent.eventFrom.toLowerCase().includes(obj.searchTerm.toLowerCase())) isFiltered = false;
|
if (thisEvent.eventFrom.toLowerCase().includes(obj.searchTerm.toLowerCase())) isFiltered = false;
|
||||||
if (thisEvent.eventTo.toLowerCase().includes(obj.searchTerm.toLowerCase())) isFiltered = false;
|
if (thisEvent.eventTo.toLowerCase().includes(obj.searchTerm.toLowerCase())) isFiltered = false;
|
||||||
if (isFiltered) continue;
|
if (isFiltered) {
|
||||||
|
filtered++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Filter Events on filter buttons
|
// Filter Events on filter buttons
|
||||||
let isFiltered = true;
|
let isFiltered = true;
|
||||||
@ -172,6 +176,7 @@ const EventViewer = (obj) => {
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (isFiltered && count) {
|
if (isFiltered && count) {
|
||||||
|
filtered++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,12 +200,12 @@ const EventViewer = (obj) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
filtered++;
|
hidden++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let showMoreButton;
|
let showMoreButton;
|
||||||
if (!hasLimited) {
|
if (hidden == 0) {
|
||||||
showMoreButton =
|
showMoreButton =
|
||||||
<div className="stroke" style={{ width: '100%', padding: 0, margin: 0, marginBottom: '2em', marginTop: '2em' }}>
|
<div className="stroke" style={{ width: '100%', padding: 0, margin: 0, marginBottom: '2em', marginTop: '2em' }}>
|
||||||
<div className="strokeSmollLeft" style={{ borderRadius: "1.2em", backgroundColor: greyColour, padding: 0, margin: 0, width: '100%' }}>
|
<div className="strokeSmollLeft" style={{ borderRadius: "1.2em", backgroundColor: greyColour, padding: 0, margin: 0, width: '100%' }}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user