mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 12:43:48 -04:00
(pl)(bug)(pronouns) fix avoiding throwing 500
This commit is contained in:
parent
96cd191bff
commit
c35a338642
@ -4,14 +4,25 @@ import { SourceLibrary } from '../src/classes.ts';
|
||||
|
||||
const config = useConfig();
|
||||
|
||||
const { data: sources } = useAsyncData(async () => {
|
||||
if (!config.pronouns.enabled || !config.pronouns.null || !config.pronouns.null.routes) {
|
||||
const key = config.pronouns.enabled && config.pronouns.null && config.pronouns.null.routes
|
||||
? config.pronouns.null.routes[0]
|
||||
: null;
|
||||
|
||||
const { data: sourcesRaw } = useAsyncData(async () => {
|
||||
if (!key) {
|
||||
return;
|
||||
}
|
||||
const key = config.pronouns.null.routes[0];
|
||||
const sourcesRaw = await $fetch(`/api/sources?pronoun=${key}`);
|
||||
|
||||
return await $fetch(`/api/sources?pronoun=${key}`);
|
||||
});
|
||||
|
||||
const sources = computed(() => {
|
||||
if (!key) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
'': new SourceLibrary(config, sourcesRaw).getForPronoun(key),
|
||||
'': new SourceLibrary(config, sourcesRaw.value).getForPronoun(key),
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user