mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 04:34:15 -04:00
fix(profile) zaimki.pl/@:username throwing "500 Error Cannot access uninitialized variable." on safari
also, clean up old "namedays" PoC, we haven't implemented it for ages, and if we do, it's better to configure in the db (`names` table)
This commit is contained in:
parent
e7be07fae6
commit
e54eb9bb51
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{ "Andrea": ["04-30"] }
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -4,7 +4,7 @@ import type { Event } from '~/src/calendar/helpers.ts';
|
||||
|
||||
export const buildCalendar = (localEvents: Event[], baseUrl: string) => {
|
||||
return new Calendar(
|
||||
[...internationalEvents, ...localEvents], // TODO , ...namedays
|
||||
[...internationalEvents, ...localEvents],
|
||||
baseUrl,
|
||||
2021,
|
||||
2025,
|
||||
|
22
src/data.ts
22
src/data.ts
@ -121,14 +121,14 @@ export const loadNameCount = async () => {
|
||||
export const loadCalendar = async () => {
|
||||
const locale = getLocale();
|
||||
const baseUrl = getUrlForLocale(locale);
|
||||
const localEvents = (await import(`~/locale/${locale}/calendar/events.ts`)).default;
|
||||
/* const rawNamedays = (await import(`~/locale/${config.locale}/names/namedays.json`)).default;
|
||||
const namedays = Object.entries(rawNamedays as Record<string, string[]>)
|
||||
.flatMap(([name, namedays]) => {
|
||||
return namedays.map((nameday) => {
|
||||
const [m, d] = nameday.split('-');
|
||||
return new Event(`nameday$${name}`, null, parseInt(m), day(parseInt(d)), EventLevel.Nameday);
|
||||
});
|
||||
}); */
|
||||
return buildCalendar(localEvents, baseUrl);
|
||||
};
|
||||
|
||||
try {
|
||||
const localEvents = (await import(`~/locale/${locale}/calendar/events.ts`)).default;
|
||||
return buildCalendar(localEvents, baseUrl);
|
||||
} catch (error) {
|
||||
// quickfix: not sure why that would happen (events.ts always exists, with at least `export default []`),
|
||||
// but apparently on Safari on Polish version (only?) we can get "500 Error Cannot access uninitialized variable."
|
||||
// returning [] still loads events correctly (via a separate request?)
|
||||
return buildCalendar([], baseUrl);
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user