Skip to content

Commit 22610a5

Browse files
fix: sponsors stopped showing up (oc api)
1 parent b63d17f commit 22610a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ window.addEventListener('load', function() {
106106
if (!data) {
107107
return;
108108
}
109-
const activeSponsors = data.filter((sponsor) => sponsor.isActive);
109+
110+
const oneMonth = 1000 * 60 * 60 * 24 * 30;
111+
const now = new Date();
112+
const activeSponsors = data.filter((sponsor) => sponsor.isActive || (sponsor.lastTransactionAt && new Date(sponsor.lastTransactionAt).getTime() > now.getTime() - oneMonth));
110113
const bronzeSponsorsContainer = document.querySelector('.bronze-sponsors-container');
111114
if (!bronzeSponsorsContainer) {
112115
return;

0 commit comments

Comments
 (0)