fix type errors
This commit is contained in:
parent
e6b7eca775
commit
38668c4c11
6 changed files with 41 additions and 8 deletions
|
@ -35,12 +35,12 @@ const ticker = ref<HTMLElement | null>(null);
|
|||
|
||||
// if no instance data is given, this is for the local instance
|
||||
const instance = props.instance ?? {
|
||||
faviconUrl: Instance.faviconUrl || Instance.iconUrl || "/favicon.ico",
|
||||
faviconUrl: Instance.iconUrl || "/favicon.ico",
|
||||
name: instanceName,
|
||||
themeColor: (
|
||||
document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement
|
||||
)?.content,
|
||||
softwareName: Instance.softwareName ?? "Firefish",
|
||||
softwareName: "Firefish",
|
||||
softwareVersion: version,
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,7 @@ const commonNames = new Map<string, string>([
|
|||
["wxwclub", "wxwClub"],
|
||||
]);
|
||||
|
||||
const capitalize = (s: string) => {
|
||||
const capitalize = (s?: string | null) => {
|
||||
if (s == null) return "Unknown";
|
||||
if (commonNames.has(s)) return commonNames.get(s);
|
||||
return s[0].toUpperCase() + s.slice(1);
|
||||
|
|
|
@ -23,7 +23,7 @@ import { i18n } from "@/i18n";
|
|||
|
||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
|
||||
const checkAnnouncements = () => {
|
||||
modal.value.close();
|
||||
modal.value!.close();
|
||||
location.href = "/announcements";
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
>
|
||||
<video
|
||||
:poster="media.thumbnailUrl"
|
||||
:aria-label="media.comment"
|
||||
:aria-label="media.comment || undefined"
|
||||
preload="none"
|
||||
controls
|
||||
playsinline
|
||||
|
|
|
@ -64,7 +64,7 @@ import "vue-plyr/dist/vue-plyr.css";
|
|||
import { i18n } from "@/i18n";
|
||||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = withDefaults(
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
media: entities.DriveFile;
|
||||
}>(),
|
||||
|
|
|
@ -63,7 +63,7 @@ export function useChartTooltip(
|
|||
} else if (opts.position === "middle") {
|
||||
tooltipY.value = rect.top + window.scrollY + context.tooltip.caretY;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
handler,
|
||||
|
|
|
@ -371,7 +371,40 @@ export type LiteInstanceMetadata = {
|
|||
};
|
||||
|
||||
export type DetailedInstanceMetadata = LiteInstanceMetadata & {
|
||||
features: Record<string, any>;
|
||||
features: {
|
||||
registration: boolean;
|
||||
localTimeLine: boolean;
|
||||
recommendedTimeLine: boolean;
|
||||
globalTimeLine: boolean;
|
||||
searchFilters: boolean;
|
||||
hcaptcha: boolean;
|
||||
recaptcha: boolean;
|
||||
objectStorage: boolean;
|
||||
serviceWorker: boolean;
|
||||
miauth?: boolean;
|
||||
};
|
||||
langs: string[];
|
||||
moreUrls: object;
|
||||
repositoryUrl: string;
|
||||
feedbackUrl: string;
|
||||
defaultDarkTheme: string | null;
|
||||
defaultLightTheme: string | null;
|
||||
enableGuestTimeline: boolean;
|
||||
cacheRemoteFiles: boolean;
|
||||
emailRequiredForSignup: boolean;
|
||||
mascotImageUrl: string;
|
||||
bannerUrl: string;
|
||||
errorImageUrl: string;
|
||||
iconUrl: string | null;
|
||||
maxCaptionTextLength: number;
|
||||
requireSetup: boolean;
|
||||
translatorAvailable: boolean;
|
||||
proxyAccountName: string | null;
|
||||
secureMode?: boolean;
|
||||
privateMode?: boolean;
|
||||
defaultReaction: string;
|
||||
donationLink?: string | null;
|
||||
enableServerMachineStats?: boolean;
|
||||
};
|
||||
|
||||
export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
|
||||
|
|
Loading…
Reference in a new issue