fix: tooltips missing

This commit is contained in:
Mar0xy 2023-11-03 15:43:52 +01:00
parent 7c480424a6
commit 5e166101e3
No known key found for this signature in database
GPG Key ID: 56569BBE47D2C828
1 changed files with 53 additions and 14 deletions

View File

@ -288,23 +288,62 @@ if (props.mock) {
});
}
if ($i && !props.mock) {
os.api("notes/renotes", {
noteId: appearNote.id,
userId: $i.id,
limit: 1,
}).then((res) => {
renoted.value = res.length > 0;
if (!props.mock) {
useTooltip(renoteButton, async (showing) => {
const renotes = await os.api('notes/renotes', {
noteId: appearNote.id,
limit: 11,
});
const users = renotes.map(x => x.user);
if (users.length < 1) return;
os.popup(MkUsersTooltip, {
showing,
users,
count: appearNote.renoteCount,
targetElement: renoteButton.value,
}, {}, 'closed');
});
os.api("notes/renotes", {
noteId: appearNote.id,
userId: $i.id,
limit: 1,
quote: true,
}).then((res) => {
quoted.value = res.length > 0;
useTooltip(quoteButton, async (showing) => {
const renotes = await os.api('notes/renotes', {
noteId: appearNote.id,
limit: 11,
quote: true,
});
const users = renotes.map(x => x.user);
if (users.length < 1) return;
os.popup(MkUsersTooltip, {
showing,
users,
count: appearNote.renoteCount,
targetElement: quoteButton.value,
}, {}, 'closed');
});
if ($i) {
os.api("notes/renotes", {
noteId: appearNote.id,
userId: $i.id,
limit: 1,
}).then((res) => {
renoted.value = res.length > 0;
});
os.api("notes/renotes", {
noteId: appearNote.id,
userId: $i.id,
limit: 1,
quote: true,
}).then((res) => {
quoted.value = res.length > 0;
});
}
}
type Visibility = 'public' | 'home' | 'followers' | 'specified';