mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-26 16:03:02 +00:00
copy changes from MkNote* to SkNote*
This commit is contained in:
parent
907bf133cd
commit
e04c7ad09f
2 changed files with 6 additions and 18 deletions
|
@ -234,6 +234,7 @@ import { host } from '@/config.js';
|
||||||
import { isEnabledUrlPreview } from '@/instance.js';
|
import { isEnabledUrlPreview } from '@/instance.js';
|
||||||
import { type Keymap } from '@/scripts/hotkey.js';
|
import { type Keymap } from '@/scripts/hotkey.js';
|
||||||
import { focusPrev, focusNext } from '@/scripts/focus.js';
|
import { focusPrev, focusNext } from '@/scripts/focus.js';
|
||||||
|
import { getAppearNote } from '@/scripts/get-appear-note.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
note: Misskey.entities.Note;
|
note: Misskey.entities.Note;
|
||||||
|
@ -285,14 +286,7 @@ if (noteViewInterruptors.length > 0) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const isRenote = (
|
const isRenote = Misskey.note.isPureRenote(note.value);
|
||||||
note.value.renote != null &&
|
|
||||||
note.value.reply == null &&
|
|
||||||
note.value.text == null &&
|
|
||||||
note.value.cw == null &&
|
|
||||||
note.value.fileIds && note.value.fileIds.length === 0 &&
|
|
||||||
note.value.poll == null
|
|
||||||
);
|
|
||||||
|
|
||||||
const rootEl = shallowRef<HTMLElement>();
|
const rootEl = shallowRef<HTMLElement>();
|
||||||
const menuButton = shallowRef<HTMLElement>();
|
const menuButton = shallowRef<HTMLElement>();
|
||||||
|
@ -303,7 +297,7 @@ const reactButton = shallowRef<HTMLElement>();
|
||||||
const quoteButton = shallowRef<HTMLElement>();
|
const quoteButton = shallowRef<HTMLElement>();
|
||||||
const clipButton = shallowRef<HTMLElement>();
|
const clipButton = shallowRef<HTMLElement>();
|
||||||
const likeButton = shallowRef<HTMLElement>();
|
const likeButton = shallowRef<HTMLElement>();
|
||||||
const appearNote = computed(() => isRenote ? note.value.renote as Misskey.entities.Note : note.value);
|
const appearNote = computed(() => getAppearNote(note.value));
|
||||||
const galleryEl = shallowRef<InstanceType<typeof MkMediaList>>();
|
const galleryEl = shallowRef<InstanceType<typeof MkMediaList>>();
|
||||||
const isMyRenote = $i && ($i.id === note.value.userId);
|
const isMyRenote = $i && ($i.id === note.value.userId);
|
||||||
const showContent = ref(defaultStore.state.uncollapseCW);
|
const showContent = ref(defaultStore.state.uncollapseCW);
|
||||||
|
|
|
@ -274,6 +274,7 @@ import MkReactionIcon from '@/components/MkReactionIcon.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import { boostMenuItems, type Visibility } from '@/scripts/boost-quote.js';
|
import { boostMenuItems, type Visibility } from '@/scripts/boost-quote.js';
|
||||||
import { isEnabledUrlPreview } from '@/instance.js';
|
import { isEnabledUrlPreview } from '@/instance.js';
|
||||||
|
import { getAppearNote } from '@/scripts/get-appear-note.js';
|
||||||
import { type Keymap } from '@/scripts/hotkey.js';
|
import { type Keymap } from '@/scripts/hotkey.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
|
@ -307,14 +308,7 @@ if (noteViewInterruptors.length > 0) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const isRenote = (
|
const isRenote = Misskey.note.isPureRenote(note.value);
|
||||||
note.value.renote != null &&
|
|
||||||
note.value.reply == null &&
|
|
||||||
note.value.text == null &&
|
|
||||||
note.value.cw == null &&
|
|
||||||
note.value.fileIds && note.value.fileIds.length === 0 &&
|
|
||||||
note.value.poll == null
|
|
||||||
);
|
|
||||||
|
|
||||||
const rootEl = shallowRef<HTMLElement>();
|
const rootEl = shallowRef<HTMLElement>();
|
||||||
const noteEl = shallowRef<HTMLElement>();
|
const noteEl = shallowRef<HTMLElement>();
|
||||||
|
@ -326,7 +320,7 @@ const reactButton = shallowRef<HTMLElement>();
|
||||||
const quoteButton = shallowRef<HTMLElement>();
|
const quoteButton = shallowRef<HTMLElement>();
|
||||||
const clipButton = shallowRef<HTMLElement>();
|
const clipButton = shallowRef<HTMLElement>();
|
||||||
const likeButton = shallowRef<HTMLElement>();
|
const likeButton = shallowRef<HTMLElement>();
|
||||||
const appearNote = computed(() => isRenote ? note.value.renote as Misskey.entities.Note : note.value);
|
const appearNote = computed(() => getAppearNote(note.value));
|
||||||
const galleryEl = shallowRef<InstanceType<typeof MkMediaList>>();
|
const galleryEl = shallowRef<InstanceType<typeof MkMediaList>>();
|
||||||
const isMyRenote = $i && ($i.id === note.value.userId);
|
const isMyRenote = $i && ($i.id === note.value.userId);
|
||||||
const showContent = ref(defaultStore.state.uncollapseCW);
|
const showContent = ref(defaultStore.state.uncollapseCW);
|
||||||
|
|
Loading…
Reference in a new issue