summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkSubNoteContent.vue
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-03-31 14:53:02 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-03-31 14:53:02 -0400
commitc371af34e877845e01cd92683aca0ff3334e314a (patch)
treee34c80fc5c134a87f6ce01cbd93d6163c08c0a7d /packages/frontend/src/components/MkSubNoteContent.vue
parentregenerate misskey-js (diff)
downloadsharkey-c371af34e877845e01cd92683aca0ff3334e314a.tar.gz
sharkey-c371af34e877845e01cd92683aca0ff3334e314a.tar.bz2
sharkey-c371af34e877845e01cd92683aca0ff3334e314a.zip
copy sharkey settings into new frontend preferences model
Diffstat (limited to 'packages/frontend/src/components/MkSubNoteContent.vue')
-rw-r--r--packages/frontend/src/components/MkSubNoteContent.vue16
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue
index 2ac34431c4..256c84f9b6 100644
--- a/packages/frontend/src/components/MkSubNoteContent.vue
+++ b/packages/frontend/src/components/MkSubNoteContent.vue
@@ -5,13 +5,13 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div :class="[$style.root, { [$style.collapsed]: collapsed }]">
- <div :class="{ [$style.clickToOpen]: defaultStore.state.clickToOpen }" @click.stop="defaultStore.state.clickToOpen ? noteclick(note.id) : undefined">
+ <div :class="{ [$style.clickToOpen]: prefer.s.clickToOpen }" @click.stop="prefer.s.clickToOpen ? noteclick(note.id) : undefined">
<span v-if="note.isHidden" style="opacity: 0.5">({{ i18n.ts.private }})</span>
<span v-if="note.deletedAt" style="opacity: 0.5">({{ i18n.ts.deletedNote }})</span>
<MkA v-if="note.replyId" :class="$style.reply" :to="`/notes/${note.replyId}`" @click.stop><i class="ph-arrow-bend-left-up ph-bold ph-lg"></i></MkA>
<Mfm v-if="note.text" :text="note.text" :isBlock="true" :author="note.user" :nyaize="'respect'" :isAnim="allowAnim" :emojiUrls="note.emojis"/>
<MkButton v-if="!allowAnim && animated && !hideFiles" :class="$style.playMFMButton" :small="true" @click="animatedMFM()" @click.stop><i class="ph-play ph-bold ph-lg "></i> {{ i18n.ts._animatedMFM.play }}</MkButton>
- <MkButton v-else-if="!defaultStore.state.animatedMfm && allowAnim && animated && !hideFiles" :class="$style.playMFMButton" :small="true" @click="animatedMFM()" @click.stop><i class="ph-stop ph-bold ph-lg "></i> {{ i18n.ts._animatedMFM.stop }}</MkButton>
+ <MkButton v-else-if="!prefer.s.animatedMfm && allowAnim && animated && !hideFiles" :class="$style.playMFMButton" :small="true" @click="animatedMFM()" @click.stop><i class="ph-stop ph-bold ph-lg "></i> {{ i18n.ts._animatedMFM.stop }}</MkButton>
<div v-if="note.text && translating || note.text && translation" :class="$style.translation">
<MkLoading v-if="translating" mini/>
<div v-else>
@@ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<MkA v-if="note.renoteId" :class="$style.rp" :to="`/notes/${note.renoteId}`" @click.stop>RN: ...</MkA>
</div>
- <details v-if="note.files && note.files.length > 0" :open="!defaultStore.state.collapseFiles && !hideFiles">
+ <details v-if="note.files && note.files.length > 0" :open="!prefer.s.collapseFiles && !hideFiles">
<summary>({{ i18n.tsx.withNFiles({ n: note.files.length }) }})</summary>
<MkMediaList :mediaList="note.files"/>
</details>
@@ -47,10 +47,10 @@ import MkMediaList from '@/components/MkMediaList.vue';
import MkPoll from '@/components/MkPoll.vue';
import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n.js';
-import { defaultStore } from '@/store.js';
-import { useRouter } from '@/router/supplier.js';
import * as os from '@/os.js';
import { checkAnimationFromMfm } from '@/utility/check-animated-mfm.js';
+import { useRouter } from '@/router';
+import { prefer } from '@/preferences.js';
const props = defineProps<{
note: Misskey.entities.Note;
@@ -63,7 +63,7 @@ const props = defineProps<{
const router = useRouter();
function noteclick(id: string) {
- const selection = document.getSelection();
+ const selection = window.document.getSelection();
if (selection?.toString().length === 0) {
router.push(`/notes/${id}`);
}
@@ -71,9 +71,9 @@ function noteclick(id: string) {
const parsed = computed(() => props.note.text ? mfm.parse(props.note.text) : null);
const animated = computed(() => parsed.value ? checkAnimationFromMfm(parsed.value) : null);
-let allowAnim = ref(defaultStore.state.advancedMfm && defaultStore.state.animatedMfm ? true : false);
+let allowAnim = ref(prefer.s.advancedMfm && prefer.s.animatedMfm);
-const isLong = defaultStore.state.expandLongNote && !props.hideFiles ? false : shouldCollapsed(props.note, []);
+const isLong = prefer.s.expandLongNote && !props.hideFiles ? false : shouldCollapsed(props.note, []);
function animatedMFM() {
if (allowAnim.value) {