diff --git a/packages/frontend-embed/src/components/EmCustomEmoji.vue b/packages/frontend-embed/src/components/EmCustomEmoji.vue index 6d96f682e4a1..e4149cf363f3 100644 --- a/packages/frontend-embed/src/components/EmCustomEmoji.vue +++ b/packages/frontend-embed/src/components/EmCustomEmoji.vue @@ -29,7 +29,7 @@ import { customEmojisMap } from '@/custom-emojis.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ name: string; diff --git a/packages/frontend-embed/src/components/EmInstanceTicker.vue b/packages/frontend-embed/src/components/EmInstanceTicker.vue index 1fa101427682..6bea697a65fa 100644 --- a/packages/frontend-embed/src/components/EmInstanceTicker.vue +++ b/packages/frontend-embed/src/components/EmInstanceTicker.vue @@ -15,7 +15,7 @@ import { computed, inject } from 'vue'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ instance: { diff --git a/packages/frontend/src/components/MkCropperDialog.vue b/packages/frontend/src/components/MkCropperDialog.vue index 7879e1d982a4..ad85d030367d 100644 --- a/packages/frontend/src/components/MkCropperDialog.vue +++ b/packages/frontend/src/components/MkCropperDialog.vue @@ -44,7 +44,7 @@ import { i18n } from '@/i18n.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const emit = defineEmits<{ (ev: 'ok', cropped: Misskey.entities.DriveFile): void; diff --git a/packages/frontend/src/components/MkInstanceCardMini.vue b/packages/frontend/src/components/MkInstanceCardMini.vue index 36827a0f3108..615289eda1aa 100644 --- a/packages/frontend/src/components/MkInstanceCardMini.vue +++ b/packages/frontend/src/components/MkInstanceCardMini.vue @@ -22,7 +22,7 @@ import { misskeyApiGet } from '@/scripts/misskey-api.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ instance: Misskey.entities.FederationInstance; diff --git a/packages/frontend/src/components/MkInstanceTicker.vue b/packages/frontend/src/components/MkInstanceTicker.vue index c7f4cbe65ce1..a0f9ac84edbb 100644 --- a/packages/frontend/src/components/MkInstanceTicker.vue +++ b/packages/frontend/src/components/MkInstanceTicker.vue @@ -16,7 +16,8 @@ import { instanceName } from '@/config.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const serverMetadata = inject(DI.serverMetadata)!; +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ instance?: { @@ -32,7 +33,7 @@ const instance = props.instance ?? { themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content, }; -const faviconUrl = computed(() => props.instance ? mediaProxy.getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : mediaProxy.getProxiedImageUrlNullable(Instance.iconUrl, 'preview') ?? '/favicon.ico'); +const faviconUrl = computed(() => props.instance ? mediaProxy.getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : mediaProxy.getProxiedImageUrlNullable(serverMetadata.iconUrl, 'preview') ?? '/favicon.ico'); const themeColor = instance.themeColor ?? '#777777'; diff --git a/packages/frontend/src/components/MkMediaImage.vue b/packages/frontend/src/components/MkMediaImage.vue index df13eb04b086..623857d9cb2e 100644 --- a/packages/frontend/src/components/MkMediaImage.vue +++ b/packages/frontend/src/components/MkMediaImage.vue @@ -62,7 +62,7 @@ import { $i, iAmModerator } from '@/account.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = withDefaults(defineProps<{ image: Misskey.entities.DriveFile; diff --git a/packages/frontend/src/components/MkMention.vue b/packages/frontend/src/components/MkMention.vue index 6b6e911dec69..4322924d33b1 100644 --- a/packages/frontend/src/components/MkMention.vue +++ b/packages/frontend/src/components/MkMention.vue @@ -24,7 +24,7 @@ import { MkABehavior } from '@/components/global/MkA.vue'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ username: string; diff --git a/packages/frontend/src/components/MkTimeline.vue b/packages/frontend/src/components/MkTimeline.vue index bab93e40bc0f..caf25b8fa200 100644 --- a/packages/frontend/src/components/MkTimeline.vue +++ b/packages/frontend/src/components/MkTimeline.vue @@ -77,7 +77,7 @@ function prepend(note) { tlNotesCount++; - if (instance.notesPerOneAd > 0 && tlNotesCount % instance.notesPerOneAd === 0) { + if (serverMetadata.notesPerOneAd > 0 && tlNotesCount % serverMetadata.notesPerOneAd === 0) { note._shouldInsertAd_ = true; } diff --git a/packages/frontend/src/components/MkUserInfo.vue b/packages/frontend/src/components/MkUserInfo.vue index e36988a21299..14c71c8ec613 100644 --- a/packages/frontend/src/components/MkUserInfo.vue +++ b/packages/frontend/src/components/MkUserInfo.vue @@ -46,7 +46,7 @@ import { defaultStore } from '@/store.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; defineProps<{ user: Misskey.entities.UserDetailed; diff --git a/packages/frontend/src/components/MkUserPopup.vue b/packages/frontend/src/components/MkUserPopup.vue index 5829e8d1265c..f7a02aefb0a0 100644 --- a/packages/frontend/src/components/MkUserPopup.vue +++ b/packages/frontend/src/components/MkUserPopup.vue @@ -70,7 +70,7 @@ import { isFollowingVisibleForMe, isFollowersVisibleForMe } from '@/scripts/isFf import { DI } from '@/di.js'; const serverMetadata = inject(DI.serverMetadata)!; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ showing: boolean; diff --git a/packages/frontend/src/components/global/MkAvatar.vue b/packages/frontend/src/components/global/MkAvatar.vue index c89dabd5ef13..4bf7bba20510 100644 --- a/packages/frontend/src/components/global/MkAvatar.vue +++ b/packages/frontend/src/components/global/MkAvatar.vue @@ -51,7 +51,7 @@ import { defaultStore } from '@/store.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const animation = ref(defaultStore.state.animation); const squareAvatars = ref(defaultStore.state.squareAvatars); diff --git a/packages/frontend/src/components/global/MkCustomEmoji.vue b/packages/frontend/src/components/global/MkCustomEmoji.vue index 5d033f2a5baa..2602882fafcc 100644 --- a/packages/frontend/src/components/global/MkCustomEmoji.vue +++ b/packages/frontend/src/components/global/MkCustomEmoji.vue @@ -37,7 +37,7 @@ import MkCustomEmojiDetailedDialog from '@/components/MkCustomEmojiDetailedDialo import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ name: string; diff --git a/packages/frontend/src/pages/instance-info.vue b/packages/frontend/src/pages/instance-info.vue index c8b43d71af1c..5e123e53e5e9 100644 --- a/packages/frontend/src/pages/instance-info.vue +++ b/packages/frontend/src/pages/instance-info.vue @@ -157,7 +157,7 @@ import MkTextarea from '@/components/MkTextarea.vue'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ host: string; diff --git a/packages/frontend/src/pages/page.vue b/packages/frontend/src/pages/page.vue index 6c8b9a41c192..5011968157bb 100644 --- a/packages/frontend/src/pages/page.vue +++ b/packages/frontend/src/pages/page.vue @@ -124,7 +124,7 @@ import { MenuItem } from '@/types/menu'; import { DI } from '@/di.js'; const serverMetadata = inject(DI.serverMetadata)!; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const router = useRouter(); diff --git a/packages/frontend/src/pages/settings/index.vue b/packages/frontend/src/pages/settings/index.vue index e05cc8592906..61eb45ef3e19 100644 --- a/packages/frontend/src/pages/settings/index.vue +++ b/packages/frontend/src/pages/settings/index.vue @@ -229,7 +229,7 @@ watch(router.currentRef, (to) => { } }); -const emailNotConfigured = computed(() => instance.enableEmail && ($i.email == null || !$i.emailVerified)); +const emailNotConfigured = computed(() => serverMetadata.enableEmail && ($i.email == null || !$i.emailVerified)); provideMetadataReceiver((metadataGetter) => { const info = metadataGetter(); diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index ec94782d9bcf..eb296342d190 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -178,7 +178,7 @@ import { useRouter } from '@/router/supplier.js'; import { DI } from '@/di.js'; const serverMetadata = inject(DI.serverMetadata)!; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; function calcAge(birthdate: string): number { const date = new Date(birthdate); diff --git a/packages/frontend/src/pages/user/index.files.vue b/packages/frontend/src/pages/user/index.files.vue index dc5ccda1f330..1cbead15b04f 100644 --- a/packages/frontend/src/pages/user/index.files.vue +++ b/packages/frontend/src/pages/user/index.files.vue @@ -44,7 +44,7 @@ import { i18n } from '@/i18n.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ user: Misskey.entities.UserDetailed; diff --git a/packages/frontend/src/pages/welcome.entrance.a.vue b/packages/frontend/src/pages/welcome.entrance.a.vue index 8fb628e92936..126676a8e044 100644 --- a/packages/frontend/src/pages/welcome.entrance.a.vue +++ b/packages/frontend/src/pages/welcome.entrance.a.vue @@ -48,7 +48,7 @@ import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue'; import { DI } from '@/di.js'; const serverMetadata = inject(DI.serverMetadata)!; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const instances = ref(); diff --git a/packages/frontend/src/ui/_common_/statusbar-federation.vue b/packages/frontend/src/ui/_common_/statusbar-federation.vue index c32d48a79447..c3d2d44cf4f9 100644 --- a/packages/frontend/src/ui/_common_/statusbar-federation.vue +++ b/packages/frontend/src/ui/_common_/statusbar-federation.vue @@ -39,7 +39,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js'; import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const props = defineProps<{ display?: 'marquee' | 'oneByOne'; diff --git a/packages/frontend/src/widgets/WidgetFederation.vue b/packages/frontend/src/widgets/WidgetFederation.vue index a9f752f9fc22..d21836914f82 100644 --- a/packages/frontend/src/widgets/WidgetFederation.vue +++ b/packages/frontend/src/widgets/WidgetFederation.vue @@ -58,7 +58,7 @@ const { widgetProps, configure } = useWidgetPropsManager(name, import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const instances = ref([]); const charts = ref([]); diff --git a/packages/frontend/src/widgets/WidgetInstanceCloud.vue b/packages/frontend/src/widgets/WidgetInstanceCloud.vue index 26a259e12829..84f9fc58fc07 100644 --- a/packages/frontend/src/widgets/WidgetInstanceCloud.vue +++ b/packages/frontend/src/widgets/WidgetInstanceCloud.vue @@ -50,7 +50,7 @@ const { widgetProps, configure } = useWidgetPropsManager(name, import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const cloud = shallowRef | null>(); const activeInstances = shallowRef(null); diff --git a/packages/frontend/src/widgets/WidgetPhotos.vue b/packages/frontend/src/widgets/WidgetPhotos.vue index 0e41f2be84b7..dcb08c61500f 100644 --- a/packages/frontend/src/widgets/WidgetPhotos.vue +++ b/packages/frontend/src/widgets/WidgetPhotos.vue @@ -58,7 +58,7 @@ const { widgetProps, configure } = useWidgetPropsManager(name, import { DI } from '@/di.js'; -const mediaProxy = inject(DI.mediaProxy); +const mediaProxy = inject(DI.mediaProxy)!; const connection = useStream().useChannel('main'); const images = ref([]);