feat: akce "Neobědvám" přímo z push notifikace
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful
This commit is contained in:
@@ -68,6 +68,17 @@ export function getVapidPublicKey(): string | undefined {
|
||||
return process.env.VAPID_PUBLIC_KEY;
|
||||
}
|
||||
|
||||
/** Najde login uživatele podle push subscription endpointu. */
|
||||
export async function findLoginByEndpoint(endpoint: string): Promise<string | undefined> {
|
||||
const registry = await getRegistry();
|
||||
for (const [login, entry] of Object.entries(registry)) {
|
||||
if (entry.subscription.endpoint === endpoint) {
|
||||
return login;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/** Zkontroluje a odešle připomínky uživatelům, kteří si nezvolili oběd. */
|
||||
async function checkAndSendReminders(): Promise<void> {
|
||||
// Přeskočit víkendy
|
||||
|
||||
Reference in New Issue
Block a user