mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-22 12:03:25 -04:00
(nuxt) migrate default value of useAsyncData / useFetch
https://nuxt.com/docs/4.x/getting-started/upgrade#default-data-and-error-values-in-useasyncdata-and-usefetch
This commit is contained in:
parent
a5491ece49
commit
15fc84202e
@ -2,12 +2,12 @@
|
||||
import type { SourceRaw, Source } from '~~/shared/classes.ts';
|
||||
|
||||
const props = defineProps<{
|
||||
sources: (SourceRaw | Source)[] | null;
|
||||
sources: (SourceRaw | Source)[] | undefined;
|
||||
label: string;
|
||||
}>();
|
||||
|
||||
const publishDates = computed(() => {
|
||||
if (props.sources === null) {
|
||||
if (props.sources === undefined) {
|
||||
return null;
|
||||
}
|
||||
const dates: Record<number, number> = {};
|
||||
|
@ -8,7 +8,7 @@ const heartbeatHost = runtimeConfig.public.heartbeatLink;
|
||||
const overall = ref(true);
|
||||
|
||||
const activeStats = computed(() => {
|
||||
if (stats.value === null) {
|
||||
if (stats.value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
hash: string | null;
|
||||
hash: string | undefined;
|
||||
}>();
|
||||
|
||||
const base = 'https://gitlab.com/PronounsPage/PronounsPage/-/commit';
|
||||
|
@ -55,7 +55,7 @@ const nounsAsyncData = useAsyncData(
|
||||
);
|
||||
|
||||
const loadNouns = async (): Promise<void> => {
|
||||
if (nounsAsyncData.data.value === null) {
|
||||
if (nounsAsyncData.data.value === undefined) {
|
||||
await nounsAsyncData.execute();
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ const pronounGroup = pronounLibrary.find(props.pronoun);
|
||||
const comprehensive = useComprehensive();
|
||||
|
||||
const sourceLibrary = computed(() => {
|
||||
if (sources.value === null) {
|
||||
if (sources.value === undefined) {
|
||||
return null;
|
||||
}
|
||||
return new SourceLibrary(config, sources.value);
|
||||
|
@ -39,7 +39,7 @@ watch(year, () => {
|
||||
cells.value.get('1-0')?.focus();
|
||||
});
|
||||
|
||||
const buildTimesheet = (persistent: TimesheetData | null): Timesheet => {
|
||||
const buildTimesheet = (persistent: TimesheetData | undefined): Timesheet => {
|
||||
const timesheet: Timesheet = {};
|
||||
for (let y = min.year; y <= max.year; y++) {
|
||||
timesheet[y] = {};
|
||||
|
@ -23,7 +23,7 @@ const filter = useFilterWithCategory();
|
||||
|
||||
const { data: rawSources } = await useFetch('/api/sources', { lazy: true });
|
||||
const sourceLibrary = computed(() => {
|
||||
if (rawSources.value === null) {
|
||||
if (rawSources.value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return new SourceLibrary(config, rawSources.value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user