Accessible label in MKNote should be a computed value. Also Fixes renoted note labels
This commit is contained in:
parent
fd9d23f3cb
commit
c240e37be9
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 += `${note.text}`;
|
||||
label += `${props.note.renote.text}; `;
|
||||
}
|
||||
|
||||
|
||||
label += `${note.createdAt.toLocaleUpperCase()}`;
|
||||
} else {
|
||||
if (props.note.cw) {
|
||||
label += `content warning: ${props.note.cw}; `;
|
||||
} else {
|
||||
label += `${props.note.text}; `;
|
||||
}
|
||||
}
|
||||
const date = new Date(props.note.createdAt);
|
||||
label += `${date.toDateString()}`;
|
||||
return label;
|
||||
}
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
focus,
|
||||
blur,
|
||||
|
|
Loading…
Reference in a new issue