mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 22:17:30 -07:00
Accessible label in MKNote should be a computed value. Also Fixes renoted note labels
This commit is contained in:
parent
b8f90e192b
commit
339c0705c0
1 changed files with 18 additions and 12 deletions
|
@ -461,21 +461,27 @@ function readPromo() {
|
|||
isDeleted.value = true;
|
||||
}
|
||||
|
||||
let accessibleLabel: string = getAccessibleLabel();
|
||||
|
||||
function getAccessibleLabel(): string {
|
||||
let label = `${note.user.name ? note.user.name : note.user.username}: `;
|
||||
if (note.cw && note.isHidden) {
|
||||
label += `Content Warning: ${note.cw}`;
|
||||
|
||||
const accessibleLabel = computed(() => {
|
||||
let label = `${props.note.user.username}; `;
|
||||
if (props.note.renote) {
|
||||
label += `boosted ${props.note.renote.user.username}; `;
|
||||
if (props.note.renote.cw) {
|
||||
label += `content warning: ${props.note.renote.cw}; `;
|
||||
} else {
|
||||
label += `${props.note.renote.text}; `;
|
||||
}
|
||||
} else {
|
||||
label += `${note.text}`;
|
||||
if (props.note.cw) {
|
||||
label += `content warning: ${props.note.cw}; `;
|
||||
} else {
|
||||
label += `${props.note.text}; `;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
label += `${note.createdAt.toLocaleUpperCase()}`;
|
||||
const date = new Date(props.note.createdAt);
|
||||
label += `${date.toDateString()}`;
|
||||
return label;
|
||||
}
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
focus,
|
||||
blur,
|
||||
|
|
Loading…
Reference in a new issue