mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ✨ Add quoting, replies, refactor parts of old code
This commit is contained in:
parent
0f214b6a17
commit
b4e682a562
8 changed files with 167 additions and 64 deletions
|
|
@ -5,7 +5,14 @@ type ApplicationEvents = {
|
|||
"note:reply": Status;
|
||||
"note:delete": Status;
|
||||
"note:edit": Status;
|
||||
"note:like": Status;
|
||||
"note:unlike": Status;
|
||||
"note:reblog": Status;
|
||||
"note:unreblog": Status;
|
||||
"note:quote": Status;
|
||||
"composer:open": undefined;
|
||||
"composer:reply": Status;
|
||||
"composer:quote": Status;
|
||||
"composer:send": Status;
|
||||
"composer:close": undefined;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,10 +5,15 @@ export const useNoteData = (
|
|||
noteProp: MaybeRef<Status | undefined>,
|
||||
client: Ref<Mastodon | null>,
|
||||
) => {
|
||||
const renderedNote = computed(
|
||||
() => toValue(noteProp)?.reblog ?? toValue(noteProp),
|
||||
const isQuote = computed(() => !!toValue(noteProp)?.quote);
|
||||
const isReblog = computed(
|
||||
() => !isQuote.value && !!toValue(noteProp)?.reblog,
|
||||
);
|
||||
const renderedNote = computed(() =>
|
||||
isReblog.value
|
||||
? toValue(noteProp)?.reblog ?? toValue(noteProp)
|
||||
: toValue(noteProp),
|
||||
);
|
||||
const isReblog = computed(() => !!toValue(noteProp)?.reblog);
|
||||
const shouldHide = computed(
|
||||
() =>
|
||||
renderedNote.value?.sensitive ||
|
||||
|
|
@ -31,7 +36,7 @@ export const useNoteData = (
|
|||
renderedNote.value?.account.emojis ?? [],
|
||||
);
|
||||
const reblog = computed(() =>
|
||||
isReblog.value && renderedNote.value
|
||||
isReblog.value && renderedNote.value && !isQuote.value
|
||||
? {
|
||||
avatar: renderedNote.value.account.avatar,
|
||||
acct: renderedNote.value.account.acct,
|
||||
|
|
@ -57,6 +62,7 @@ export const useNoteData = (
|
|||
loaded,
|
||||
note: renderedNote,
|
||||
content,
|
||||
isQuote,
|
||||
reblog,
|
||||
reblogDisplayName,
|
||||
shouldHide,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue