Merge branch 'production'

This commit is contained in:
Dobromir Popov
2024-05-29 18:37:26 +03:00
3 changed files with 10 additions and 10 deletions

View File

@ -259,5 +259,5 @@ in schedule admin - if a publisher is always pair & family is not in the shift -
[] revise import/export to word [] revise import/export to word
[] allow keyman/scheduler role [] allow keyman/scheduler role
[] allow blocking of inputs (different from publishing) [] allow blocking of inputs (different from publishing)
[] user - add createdAt field

View File

@ -346,17 +346,17 @@ function PwaManager({ subs }) {
> >
Спри известията на всички мои устройства {_subs != "" ? `(${_subs})` : ""} Спри известията на всички мои устройства {_subs != "" ? `(${_subs})` : ""}
</button> </button>
<button
onClick={sendTestNotification}
disabled={!isSubscribed}
className={`text-xs py-1 px-2 rounded-full focus:outline-none transition duration-150 ease-in-out ${!isSubscribed ? 'cursor-not-allowed bg-gray-300 text-gray-500' : 'bg-yellow-500 hover:bg-yellow-600 text-white'
}`}
>
Тестово уведомление
</button>
</div> </div>
{isAdmin && {isAdmin &&
<div> <div>
<button
onClick={sendTestNotification}
disabled={!isSubscribed}
className={`text-xs py-1 px-2 rounded-full focus:outline-none transition duration-150 ease-in-out ${!isSubscribed ? 'cursor-not-allowed bg-gray-300 text-gray-500' : 'bg-yellow-500 hover:bg-yellow-600 text-white'
}`}
>
Send Test Notification
</button>
<button <button
onClick={sendTestReminder} onClick={sendTestReminder}
disabled={!isSubscribed} disabled={!isSubscribed}

View File

@ -152,7 +152,7 @@ export const sendPush = async (id, title, message, actions) => {
where: { id } where: { id }
}) })
if (Array.isArray(publisher.pushSubscription) && publisher.pushSubscription.length) { if (publisher.pushSubscription && Array.isArray(publisher.pushSubscription) && publisher.pushSubscription.length) {
for (const subscription of publisher.pushSubscription) { for (const subscription of publisher.pushSubscription) {
await webPush await webPush
.sendNotification( .sendNotification(