mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-03 11:26:14 +02:00
refactor
This commit is contained in:
@@ -117,7 +117,7 @@ windowRouter.addListener('change', ctx => {
|
||||
windowRouter.init();
|
||||
|
||||
provide(DI.router, windowRouter);
|
||||
provide('inAppSearchMarkerId', searchMarkerId);
|
||||
provide(DI.inAppSearchMarkerId, searchMarkerId);
|
||||
provideMetadataReceiver((metadataGetter) => {
|
||||
const info = metadataGetter();
|
||||
pageMetadata.value = info;
|
||||
@@ -125,7 +125,7 @@ provideMetadataReceiver((metadataGetter) => {
|
||||
provideReactiveMetadata(pageMetadata);
|
||||
provide('shouldOmitHeaderTitle', true);
|
||||
provide('shouldHeaderThin', true);
|
||||
provide('forceSpacerMin', true);
|
||||
provide(DI.forceSpacerMin, true);
|
||||
|
||||
const contextmenu = computed(() => ([{
|
||||
icon: 'ti ti-player-eject',
|
||||
|
||||
@@ -14,6 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts" setup>
|
||||
import { inject } from 'vue';
|
||||
import { deviceKind } from '@/utility/device-kind.js';
|
||||
import { DI } from '@/di.js';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
contentMax?: number | null;
|
||||
@@ -25,7 +26,7 @@ const props = withDefaults(defineProps<{
|
||||
marginMax: 24,
|
||||
});
|
||||
|
||||
const forceSpacerMin = inject('forceSpacerMin', false) || deviceKind === 'smartphone';
|
||||
const forceSpacerMin = inject(DI.forceSpacerMin, false) || deviceKind === 'smartphone';
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
useTemplateRef,
|
||||
inject,
|
||||
} from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
import { DI } from '@/di.js';
|
||||
|
||||
const props = defineProps<{
|
||||
markerId?: string;
|
||||
@@ -36,7 +36,7 @@ const rootEl = useTemplateRef('root');
|
||||
const rootElMutationObserver = new MutationObserver(() => {
|
||||
checkChildren();
|
||||
});
|
||||
const injectedSearchMarkerId = inject<Ref<string | null> | null>('inAppSearchMarkerId', null);
|
||||
const injectedSearchMarkerId = inject(DI.inAppSearchMarkerId, null);
|
||||
const searchMarkerId = computed(() => injectedSearchMarkerId?.value ?? window.location.hash.slice(1));
|
||||
const highlighted = ref(props.markerId === searchMarkerId.value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user