🎉 happy birthday LibreChat (#1768)

* happy birthday LibreChat

* Refactor endpoint condition in Landing component

* Update birthday message in Eng.tsx

* fix(/config): avoid nesting ternaries

* refactor(/config): check birthday

---------

Co-authored-by: Danny Avila <messagedaniel@protonmail.com>
This commit is contained in:
Marco Beretta 2024-02-11 15:10:12 +01:00 committed by GitHub
parent 14b61fc861
commit a91042b6b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 169 additions and 43 deletions

View file

@ -7,6 +7,11 @@ const emailLoginEnabled =
process.env.ALLOW_EMAIL_LOGIN === undefined || isEnabled(process.env.ALLOW_EMAIL_LOGIN);
router.get('/', async function (req, res) {
const isBirthday = () => {
const today = new Date();
return today.getMonth() === 1 && today.getDate() === 11;
};
try {
const payload = {
appTitle: process.env.APP_TITLE || 'LibreChat',
@ -33,6 +38,10 @@ router.get('/', async function (req, res) {
!!process.env.EMAIL_PASSWORD &&
!!process.env.EMAIL_FROM,
checkBalance: isEnabled(process.env.CHECK_BALANCE),
showBirthdayIcon:
isBirthday() ||
isEnabled(process.env.SHOW_BIRTHDAY_ICON) ||
process.env.SHOW_BIRTHDAY_ICON === '',
};
if (typeof process.env.CUSTOM_FOOTER === 'string') {