(cherry picked from commit d3c1926519)
This commit is contained in:
syuilo 2024-09-02 20:41:58 +09:00 committed by kakkokari-gtyih
parent 5b00b778cf
commit c258175208
20 changed files with 22 additions and 21 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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';

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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();

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

View File

@ -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);

View File

@ -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;

View File

@ -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<Misskey.entities.FederationInstance[]>();

View File

@ -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';

View File

@ -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<Misskey.entities.FederationInstance[]>([]);
const charts = ref<Misskey.entities.ChartsInstanceResponse[]>([]);

View File

@ -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<InstanceType<typeof MkTagCloud> | 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';
const mediaProxy = inject(DI.mediaProxy);
const mediaProxy = inject(DI.mediaProxy)!;
const connection = useStream().useChannel('main');
const images = ref<Misskey.entities.DriveFile[]>([]);