Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Sep 2, 2024
1 parent 27c7900 commit d3c1926
Show file tree
Hide file tree
Showing 22 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/components/EmCustomEmoji.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkCropperDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkInstanceCardMini.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions packages/frontend/src/components/MkInstanceTicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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?: {
Expand All @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkMediaImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkMention.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkUserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkUserPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/global/MkAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/global/MkCustomEmoji.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/instance-info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/user/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/user/index.files.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/welcome.entrance.a.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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[]>();

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/ui/_common_/statusbar-federation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/widgets/WidgetFederation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/widgets/WidgetInstanceCloud.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/widgets/WidgetPhotos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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[]>([]);
Expand Down

0 comments on commit d3c1926

Please sign in to comment.