This commit is contained in:
syuilo 2024-09-02 20:41:58 +09:00
parent 27c7900b0c
commit d3c1926519
22 changed files with 24 additions and 23 deletions

View file

@ -29,7 +29,7 @@ import { customEmojisMap } from '@/custom-emojis.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
name: string; name: string;

View file

@ -15,7 +15,7 @@ import { computed, inject } from 'vue';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
instance: { instance: {

View file

@ -44,7 +44,7 @@ import { i18n } from '@/i18n.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const emit = defineEmits<{ const emit = defineEmits<{
(ev: 'ok', cropped: Misskey.entities.DriveFile): void; (ev: 'ok', cropped: Misskey.entities.DriveFile): void;

View file

@ -22,7 +22,7 @@ import { misskeyApiGet } from '@/scripts/misskey-api.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
instance: Misskey.entities.FederationInstance; instance: Misskey.entities.FederationInstance;

View file

@ -16,7 +16,8 @@ import { instanceName } from '@/config.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const serverMetadata = inject(DI.serverMetadata)!;
const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
instance?: { instance?: {
@ -32,7 +33,7 @@ const instance = props.instance ?? {
themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content, 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'; const themeColor = instance.themeColor ?? '#777777';

View file

@ -62,7 +62,7 @@ import { $i, iAmModerator } from '@/account.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
image: Misskey.entities.DriveFile; image: Misskey.entities.DriveFile;

View file

@ -24,7 +24,7 @@ import { MkABehavior } from '@/components/global/MkA.vue';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
username: string; username: string;

View file

@ -77,7 +77,7 @@ function prepend(note) {
tlNotesCount++; tlNotesCount++;
if (instance.notesPerOneAd > 0 && tlNotesCount % instance.notesPerOneAd === 0) { if (serverMetadata.notesPerOneAd > 0 && tlNotesCount % serverMetadata.notesPerOneAd === 0) {
note._shouldInsertAd_ = true; note._shouldInsertAd_ = true;
} }

View file

@ -46,7 +46,7 @@ import { defaultStore } from '@/store.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
defineProps<{ defineProps<{
user: Misskey.entities.UserDetailed; user: Misskey.entities.UserDetailed;

View file

@ -70,7 +70,7 @@ import { isFollowingVisibleForMe, isFollowersVisibleForMe } from '@/scripts/isFf
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata)!; const serverMetadata = inject(DI.serverMetadata)!;
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
showing: boolean; showing: boolean;

View file

@ -51,7 +51,7 @@ import { defaultStore } from '@/store.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const animation = ref(defaultStore.state.animation); const animation = ref(defaultStore.state.animation);
const squareAvatars = ref(defaultStore.state.squareAvatars); const squareAvatars = ref(defaultStore.state.squareAvatars);

View file

@ -37,7 +37,7 @@ import MkCustomEmojiDetailedDialog from '@/components/MkCustomEmojiDetailedDialo
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
name: string; name: string;

View file

@ -157,7 +157,7 @@ import MkTextarea from '@/components/MkTextarea.vue';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
host: string; host: string;

View file

@ -124,7 +124,7 @@ import { MenuItem } from '@/types/menu';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata)!; const serverMetadata = inject(DI.serverMetadata)!;
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const router = useRouter(); const router = useRouter();

View file

@ -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) => { provideMetadataReceiver((metadataGetter) => {
const info = metadataGetter(); const info = metadataGetter();

View file

@ -178,7 +178,7 @@ import { useRouter } from '@/router/supplier.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata)!; const serverMetadata = inject(DI.serverMetadata)!;
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
function calcAge(birthdate: string): number { function calcAge(birthdate: string): number {
const date = new Date(birthdate); const date = new Date(birthdate);

View file

@ -44,7 +44,7 @@ import { i18n } from '@/i18n.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
user: Misskey.entities.UserDetailed; user: Misskey.entities.UserDetailed;

View file

@ -48,7 +48,7 @@ import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const serverMetadata = inject(DI.serverMetadata)!; const serverMetadata = inject(DI.serverMetadata)!;
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const instances = ref<Misskey.entities.FederationInstance[]>(); const instances = ref<Misskey.entities.FederationInstance[]>();

View file

@ -39,7 +39,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const props = defineProps<{ const props = defineProps<{
display?: 'marquee' | 'oneByOne'; display?: 'marquee' | 'oneByOne';

View file

@ -58,7 +58,7 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const instances = ref<Misskey.entities.FederationInstance[]>([]); const instances = ref<Misskey.entities.FederationInstance[]>([]);
const charts = ref<Misskey.entities.ChartsInstanceResponse[]>([]); const charts = ref<Misskey.entities.ChartsInstanceResponse[]>([]);

View file

@ -50,7 +50,7 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const cloud = shallowRef<InstanceType<typeof MkTagCloud> | null>(); const cloud = shallowRef<InstanceType<typeof MkTagCloud> | null>();
const activeInstances = shallowRef<Misskey.entities.FederationInstance[] | null>(null); const activeInstances = shallowRef<Misskey.entities.FederationInstance[] | null>(null);

View file

@ -58,7 +58,7 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
import { DI } from '@/di.js'; import { DI } from '@/di.js';
const mediaProxy = inject(DI.mediaProxy); const mediaProxy = inject(DI.mediaProxy)!;
const connection = useStream().useChannel('main'); const connection = useStream().useChannel('main');
const images = ref<Misskey.entities.DriveFile[]>([]); const images = ref<Misskey.entities.DriveFile[]>([]);